Skip to content
Snippets Groups Projects
Commit 89acbaa8 authored by maljx's avatar maljx
Browse files

added make_docs.py for win10 documentation generation

parent af0fa935
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ Development
* A Egli <adrian.egli@sbb.ch>
* Mattias Ljungström <ml@mljx.io>
Contributors
------------
......
......@@ -21,12 +21,20 @@ Generate Docs
| **TODO**: Mohanty to add atleast a neat outline herefor the contents to the docs here.
.. code-block:: bash
Linux and macOS setup
git clone git@gitlab.aicrowd.com:flatland/flatland.git
cd flatland
pip install -r requirements_dev.txt
make docs
Windows Setup
git clone git@gitlab.aicrowd.com:flatland/flatland.git
cd flatland
pip install -r requirements_dev.txt
python setup.py develop
python make_docs.py
Features
--------
......@@ -36,4 +44,5 @@ Authors
--------
* Sharada Mohanty <mohanty@aicrowd.com>
* Giacomo Spigler <giacomo.spigler@gmail.com>
* Mattias Ljungström <ml@mljx.io>
<please fill yourself in>
\ No newline at end of file
#!/usr/bin/env python
import os
import webbrowser
import subprocess
def browser(pathname):
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file:" + pathname2url(pathname))
def remove_exists(filename):
try:
os.remove(filename)
except FileNotFoundError:
pass
# clean docs config and html files, and rebuild everything
remove_exists('docs/flatland.rst')
remove_exists('docs/modules.rst')
subprocess.call('sphinx-apidoc -o docs/ flatland')
os.environ["SPHINXPROJ"] = "flatland"
os.chdir('docs')
subprocess.call('python -msphinx -M clean . _build')
subprocess.call('python -msphinx -M html . _build')
browser(os.path.abspath('_build/html/index.html'))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment