8. VSCode make html and pdfο
8.1. View docs as htmlο
There are a few different ways to view how the documentation will look before pushing it to GitHub and viewing it in RTDs. The first option below displays a preview of the .rst file. The second and third option require the use of Sphinx to build the html output.
8.2. View docs as html in VSCodeο
Install the
reStructuredText
extension in VSCode, then use the Open Preview to the Side icon at the top right of the window to preview an open .rst file.
8.3. View docs as htmlο
Press ctrl + shift + ` to open the VSCode terminal.
Make sure that the terminal folder is the docs folder.
eg: C:/projects/project-name/docs
Build an html version of the docs.
make clean
make html
make clean
is needed first since Sphinx only rebuilds pages that have changed.Open the index file
_build/html/index.html
in a web browser to see the docs.The html can also be viewed in the browser using the VSCode terminal.
start chrome _build/html/index.html
Add the VSCode extension
open in browser
to add the commandopen in default browser
to the pop up menu when right clicking the html file in VSCode explorer panel.
8.4. View docs as html using localhostο
Press ctrl + shift + ` to open the VSCode terminal.
Make sure that the terminal folder is the docs folder.
eg: C:/projects/project-name/docs
Build an html version of the docs using the the VSCode terminal.
make clean
make html
Create a local server using the the VSCode terminal.
python -m http.server
Open the localhost in the browser: http://localhost:8000/_build/html/
The html can also be viewed in the browser using the the VSCode terminal.
start chrome http://localhost:8000/_build/html/
Tip
Sometimes .\
will be needed with make
.\make clean
.\make html
8.5. View docs as pdfο
Make the latex build then create the pdf from the .tex file.
8.6. Make latexο
Press ctrl + shift + ` to open the VSCode terminal.
Make sure that the terminal folder is the docs folder.
eg: C:/projects/project-name/docs
Build a latex version of the docs.
make clean
make latex
Change directory to
_build/latex
cd _build\latex
Create the pdf from the .tex file.
xelatex PC-Using-RTD.tex