Guilherme Theis
Guilherme Theis

Reputation: 175

Make HTML not working for Sphinx documentation in windows 10

I'm trying to follow the tutorial about how to set sphinx and Readthedocs together for project. I used Sphinx back in the day while in a internship, with ubuntu and the setup was quite seamless. I've just launched the sphinx-quickstart on my anaconda power shell. When I try to run make html the following error appears:

(base) PS D:\code\RaspberryServer\docs> make html
make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ make html
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (make:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException


Suggestion [3,General]: The command make was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\make". See "get-help about_Command_Precedence" for more details.

Firstly I thought it was because I had never installed MinGW. But even after doing so I don't seem to fix the problem and I have no clue to how to start looking into it. My python installation is fully based on Anaconda.

Upvotes: 7

Views: 11392

Answers (2)

Lex Li
Lex Li

Reputation: 63298

Expand the comment above.

The default site generated by sphinx assumes you use make html on multiple operating systems to generate HTML pages.

That's achieved by typical assumption that,

  • You are on macOS or Linux with (GNU) make installed, so make html executes the task defined in Makefile.
  • You are on Windows and at command prompt (cmd.exe), so make html actually calls to make.bat.

However, you are launching PowerShell console ("PS D:" indicates that), so you cannot get make html working properly. PowerShell does not know what to do with make, and won't call make.bat automatically. You need to call .\make.bat html instead.

Upvotes: 20

Csaba Hurton
Csaba Hurton

Reputation: 31

You may try to use sphinx-build. As far as I know it gets the job done and does not depend on the OS you use.

sphinx-build <sourcedir> <outputdir>

Upvotes: 2

Related Questions