Skip to content

Commit

Permalink
fix for readthedocs (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
BuczynskiRafal committed May 14, 2023
1 parent b111e1c commit d6564f2
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,46 @@
from recommonmark.parser import CommonMarkParser


sys.path.insert(0, os.path.abspath('../../'))
sys.path.insert(0, os.path.abspath('../../cs_app')) # Dodaj tę linię
os.environ['DJANGO_SETTINGS_MODULE'] = 'cs_app.settings'
sys.path.insert(0, os.path.abspath("../../"))
sys.path.insert(0, os.path.abspath("../../cs_app"))
os.environ["DJANGO_SETTINGS_MODULE"] = "cs_app.test_settings"
django.setup()


source_parsers = {
'.md': CommonMarkParser,
".md": CommonMarkParser,
}

source_suffix = ['.rst', '.md']
source_suffix = [".rst", ".md"]


def convert_readme_md_to_rst(app, docname, source):
if docname == 'index':
readme_path = os.path.join(app.srcdir, '..', '..', 'README.md')
rst_output = subprocess.check_output(['pandoc', '-f', 'markdown', '-t', 'rst', readme_path])
source[0] = rst_output.decode('utf-8')
if docname == "index":
readme_path = os.path.join(app.srcdir, "..", "..", "README.md")
rst_output = subprocess.check_output(
["pandoc", "-f", "markdown", "-t", "rst", readme_path]
)
source[0] = rst_output.decode("utf-8")
print(f"Current working directory: {os.getcwd()}")


def setup(app):
app.connect('source-read', convert_readme_md_to_rst)
app.connect("source-read", convert_readme_md_to_rst)


project = "Catchment Simulation"
copyright = "2023, Rafał Buczyński"
author = "Rafał Buczyński"

project = 'Catchment Simulation'
copyright = '2023, Rafał Buczyński'
author = 'Rafał Buczyński'
extensions = [
"sphinx.ext.coverage",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx.ext.autodoc",
]

extensions = [
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.autodoc',
]

templates_path = ['_templates']
templates_path = ["_templates"]
exclude_patterns = []

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]

0 comments on commit d6564f2

Please sign in to comment.