Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch needed to run under Windows #5

Open
simonpa71 opened this issue Jun 21, 2015 · 4 comments
Open

patch needed to run under Windows #5

simonpa71 opened this issue Jun 21, 2015 · 4 comments

Comments

@simonpa71
Copy link

Nice job, took me a few tries to get it working under Windows 7.
The Pandoc PHP wrapper , Copyright (c) Ryan Kadwell ryan@riaka.ca, appears to be written with *nix in mind, and fails under Windows.
Specifically, is searches for the path to pandoc using "which" and "is_executable" that, in my case, failed gracefully, so I could discover where to comment out the code running the checks.

Also, the instructions say to run "php composer.phar install" that results in an error. The solution, as per stack-exchange question, is to run "composer install", if the PATH is set correctly and loaded.

Can I suggest a simple comment in the instructions to say "tested under (whatever), may need some googling and light hacking to work under Windows", while somebody comes up with a better fix for the wrapper.

@dansou901
Copy link

Hi,
what exactly did you do do get it running under Windows? I'm trying to do a tutorial on how to convert MediaWiki pages to use them in a Gitlab Wiki and want to show a way how to do it under Windows (because not everyone has a Linux system at hand). Thanks!
Regards,
dansou901

@realrubberduckdev
Copy link

Did you manage to run it under windows @simonpa71 ?

@realrubberduckdev
Copy link

If it helps anyone, I have just forked to use docker (so that we can use it on windows as well) mediawiki-to-markdown

@paddlepaw
Copy link

paddlepaw commented Oct 27, 2022

Could not get docker working so I did the following quick hack for windows 10.

In file \mediawiki-to-gfm\vendor\ryakad\pandoc-php\src\Pandoc\Pandoc.php I changed:

        // Since we can not validate that the command that they give us is
        // *really* pandoc we will just check that its something.
        // If the provide no path to pandoc we will try to find it on our own
        if ( ! $executable) {
            exec('which pandoc', $output, $returnVar);			
            if ($returnVar === 0) {
                $this->executable = $output[0];
            } else {
                throw new PandocException('Unable to locate pandoc');
            }
        } else {
            $this->executable = $executable;
        }

        if ( ! is_executable($this->executable)) {
            throw new PandocException('Pandoc executable is not executable');
        }

To

        // Since we can not validate that the command that they give us is
        // *really* pandoc we will just check that its something.
        // If the provide no path to pandoc we will try to find it on our own
        if ( ! $executable) {
            //exec('which pandoc', $output, $returnVar);
            $returnVar = 0;
            if ($returnVar === 0) {
                 //just input your path to pandoc exe
	        $this->executable = 'c:/Pandoc/pandoc.exe';  
            } else {
                throw new PandocException('Unable to locate pandoc');
            }
        } else {
            $this->executable = $executable;
        }
		
        /*if ( ! is_executable($this->executable)) {
            throw new PandocException('Pandoc executable is not executable');
        }*/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants