Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary_c-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Izzard, Robert Dr (Maths & Physics)
binary_c-python
Commits
09212a21
Commit
09212a21
authored
3 years ago
by
dh00601
Browse files
Options
Downloads
Patches
Plain Diff
fixing docs generator
parent
df642163
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/source/conf.py
+33
-27
33 additions, 27 deletions
docs/source/conf.py
with
33 additions
and
27 deletions
docs/source/conf.py
+
33
−
27
View file @
09212a21
...
...
@@ -3,8 +3,9 @@ Configuration file for the Sphinx documentation builder.
This file only contains a selection of the most common options. For a full
list see the documentation:
https://www.sphinx-doc.org/en/master/usage/configuration.html
https://brendanhasz.github.io/2019/01/05/sphinx.html
https://www.sphinx-doc.org/en/master/usage/configuration.html
https://brendanhasz.github.io/2019/01/05/sphinx.html
https://www.sphinx-doc.org/en/1.5/ext/example_google.html
"""
# -- Path setup --------------------------------------------------------------
...
...
@@ -18,7 +19,33 @@ import sys
import
sphinx_rtd_theme
# https://www.sphinx-doc.org/en/1.5/ext/example_google.html
import
m2r2
from
binarycpython.utils.functions
import
(
write_binary_c_parameter_descriptions_to_rst_file
,
)
# from binarycpython.utils.grid import write_grid_options_to_rst_file
from
binarycpython.utils.grid
import
Population
from
functions
import
write_custom_footer
#
def
patched_m2r2_setup
(
app
):
"""
Function to handle the markdown parsing better
"""
try
:
return
current_m2r2_setup
(
app
)
except
(
AttributeError
):
app
.
add_source_suffix
(
"
.md
"
,
"
markdown
"
)
app
.
add_source_parser
(
m2r2
.
M2RParser
)
return
dict
(
version
=
m2r2
.
__version__
,
parallel_read_safe
=
True
,
parallel_write_safe
=
True
,
)
# Include paths for python code
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
"
.
"
))
...
...
@@ -95,44 +122,23 @@ html_static_path = ["_static"]
"""
Patching m2r2
"""
import
m2r2
current_m2r2_setup
=
m2r2
.
setup
def
patched_m2r2_setup
(
app
):
try
:
return
current_m2r2_setup
(
app
)
except
(
AttributeError
):
app
.
add_source_suffix
(
"
.md
"
,
"
markdown
"
)
app
.
add_source_parser
(
m2r2
.
M2RParser
)
return
dict
(
version
=
m2r2
.
__version__
,
parallel_read_safe
=
True
,
parallel_write_safe
=
True
,
)
#
m2r2
.
setup
=
patched_m2r2_setup
# Generate some custom documentations for this version of binarycpython and binary_c
from
binarycpython.utils.functions
import
(
write_binary_c_parameter_descriptions_to_rst_file
,
)
from
binarycpython.utils.grid_options_defaults
import
write_grid_options_to_rst_file
docs_pop
=
Population
()
print
(
"
Generating binary_c_parameters.rst
"
)
write_binary_c_parameter_descriptions_to_rst_file
(
"
binary_c_parameters.rst
"
)
print
(
"
Done
"
)
print
(
"
Generating grid_options_descriptions.rst
"
)
write_grid_options_to_rst_file
(
"
grid_options_descriptions.rst
"
)
docs_pop
.
write_grid_options_to_rst_file
(
"
grid_options_descriptions.rst
"
)
print
(
"
Done
"
)
# Generate a custom footer
from
functions
import
write_custom_footer
print
(
"
Generating custom footer
"
)
write_custom_footer
()
print
(
"
Done
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment