Skip to content

Commit

Permalink
Docs: minor fixes.
Browse files Browse the repository at this point in the history
Also moved conf.py into docs folder.
  • Loading branch information
GPMueller committed Jun 12, 2019
1 parent 71f173c commit 0ad5b3c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
8 changes: 2 additions & 6 deletions core/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,5 @@ The `State` is the object that holds every information needed for the simulation

### Further information
* [Input File Reference](Input.md)
* [How to: Energy minimisation](Use_Minimisation.md)
* [How to: LLG dynamics](Use_LLG.md)
* [How to: GNEB](Use_GNEB.md)
* [How to: HTST](Use_HTST.md)
* [How to: MMF](Use_MMF.md)
* [Input File Reference](Input.md)
* [C API Examples](C_API.md)
* [Python API Examples](Python_API.md)
2 changes: 1 addition & 1 deletion core/docs/c-api/API_Reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Full API reference
Spirit/Simulation.h <Simulation>
Spirit/State.h <State>
Spirit/System.h <System>
Spirit/Transition.h <Transition>
Spirit/Transitions.h <Transitions>
18 changes: 9 additions & 9 deletions conf.py → docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@


# The master toctree document.
master_doc = 'docs/index'
master_doc = 'index'


# man_pages = [ master_doc, ("docs/BUILD", "build", "building", "authors", "sectionbuild") ]
Expand Down Expand Up @@ -222,7 +222,7 @@ def run_apidoc(_):
build on readthedocs.
See also https://github.com/rtfd/readthedocs.org/issues/1139
"""
source_dir = os.path.abspath(os.path.dirname(__file__))
source_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..')
apidoc_dir = os.path.join(source_dir, 'core', 'docs', 'python-api')
package_dir = os.path.join(source_dir, 'core', 'python', 'spirit')

Expand All @@ -242,20 +242,20 @@ def run_apidoc(_):
'--maxdepth', '4',
]

builddir = os.path.join(source_dir, 'build')
if not os.path.exists(builddir):
os.mkdir(builddir)
subprocess.check_call(['cmake', '..', '-DSPIRIT_BUILD_FOR_CXX=OFF', '-DSPIRIT_SKIP_HTST=ON'], cwd=builddir)
subprocess.check_call(['make'], cwd=builddir)
build_dir = os.path.join(source_dir, 'build')
if not os.path.exists(build_dir):
os.mkdir(build_dir)
subprocess.check_call(['cmake', '..', '-DSPIRIT_BUILD_FOR_CXX=OFF', '-DSPIRIT_SKIP_HTST=ON'], cwd=build_dir)
subprocess.check_call(['make'], cwd=build_dir)

# See https://stackoverflow.com/a/30144019
env = os.environ.copy()
env["SPHINX_APIDOC_OPTIONS"] = 'members,special-members,private-members,undoc-members,show-inheritance'
subprocess.check_call([cmd_path] + options, env=env)
subprocess.check_call([cmd_path] + options, env=env, cwd=source_dir)

#####################
with open(os.path.join(apidoc_dir, 'parameters.rst'), "w") as parameters_file:
parameters_file.write("Parameters\n==================================\n\n")
parameters_file.write("spirit.parameters\n==================================\n\n")
with open(os.path.join(apidoc_dir, 'spirit.parameters.mc.rst'), 'r') as generated_file:
parameters_file.write(generated_file.read())
with open(os.path.join(apidoc_dir, 'spirit.parameters.llg.rst'), 'r') as generated_file:
Expand Down

0 comments on commit 0ad5b3c

Please sign in to comment.