Skip to content

Commit

Permalink
refactor(conf.py): use create_documentation_files to create rst files
Browse files Browse the repository at this point in the history
  • Loading branch information
gilrrei committed Jan 17, 2025
1 parent d366b36 commit 25f833c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 50 deletions.
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

# Add the readme example as easy tutorial for now
sys.path.insert(1, str(relative_path_from_queens("doc/source").resolve()))
from create_documentation_stuff import create_tutorial_from_readme
from create_documentation_files import main

create_tutorial_from_readme()
main()


# -- General configuration ------------------------------------------------
Expand Down
11 changes: 6 additions & 5 deletions doc/source/create_documentation_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import re
import sys

import pandoc
from pandoc import read as pandoc_read
from pandoc import write as pandoc_write

from queens.utils.path_utils import relative_path_from_queens

Expand Down Expand Up @@ -116,21 +117,21 @@ def create_testing():
"""Create pages related to testing."""
contributing_path = relative_path_from_queens("tests/README.md")
md_text = load_markdown(md_path=contributing_path)
doc = pandoc.read(md_text, format="markdown")
doc = pandoc_read(md_text, format="markdown")

rst_path = "testing.rst"
pandoc.write(doc, file=relative_to_doc_source(rst_path), format="rst")
pandoc_write(doc, file=relative_to_doc_source(rst_path), format="rst")
return rst_path


def create_contributing():
"""Create pages related to contributing."""
contributing_path = relative_path_from_queens("CONTRIBUTING.md")
md_text = load_markdown(md_path=contributing_path)
doc = pandoc.read(md_text)
doc = pandoc_read(md_text)

rst_path = "contributing.rst"
pandoc.write(doc, file=relative_to_doc_source(rst_path), format="rst")
pandoc_write(doc, file=relative_to_doc_source(rst_path), format="rst")
return rst_path


Expand Down
37 changes: 0 additions & 37 deletions doc/source/create_documentation_stuff.py

This file was deleted.

8 changes: 2 additions & 6 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.. pqueens documentation master file, created by
sphinx-quickstart on Tue Apr 4 13:44:16 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to the QUEENS' documentation!
===================================

Expand All @@ -19,7 +14,8 @@ Welcome to the QUEENS' documentation!
intro
architecture
tutorials
modules.rst
development



Indices and tables
Expand Down

0 comments on commit 25f833c

Please sign in to comment.