mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2026-07-24 19:51:50 +02:00
sphinx auto_class options
This commit is contained in:
+17
-4
@@ -19,7 +19,7 @@ extensions = ['myst_parser',
|
|||||||
'sphinx.ext.doctest',
|
'sphinx.ext.doctest',
|
||||||
'sphinx.ext.autodoc',
|
'sphinx.ext.autodoc',
|
||||||
'sphinx.ext.autosummary',
|
'sphinx.ext.autosummary',
|
||||||
|
'sphinx.ext.linkcode',
|
||||||
]
|
]
|
||||||
|
|
||||||
templates_path = ['_templates']
|
templates_path = ['_templates']
|
||||||
@@ -31,11 +31,24 @@ from pathlib import Path
|
|||||||
import sys
|
import sys
|
||||||
sys.path.insert(0, (Path(__file__).parents[2]).resolve().as_posix())
|
sys.path.insert(0, (Path(__file__).parents[2]).resolve().as_posix())
|
||||||
import sphinx_pdj_theme
|
import sphinx_pdj_theme
|
||||||
html_theme = 'sphinx_pdj_theme'
|
|
||||||
html_theme_path = [sphinx_pdj_theme.get_html_theme_path()]
|
|
||||||
|
|
||||||
# -- Options for HTML output -------------------------------------------------
|
# -- Options for HTML output -------------------------------------------------
|
||||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
||||||
|
|
||||||
html_theme = 'alabaster'
|
html_theme = 'alabaster'
|
||||||
|
html_theme_path = [sphinx_pdj_theme.get_html_theme_path()]
|
||||||
|
|
||||||
|
|
||||||
html_static_path = ['_static']
|
html_static_path = ['_static']
|
||||||
|
|
||||||
|
# In your configuration, you need to specify a linkcode_resolve function that returns an URL based on the object.
|
||||||
|
# https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html
|
||||||
|
|
||||||
|
def linkcode_resolve(domain, info):
|
||||||
|
if domain in ['py', '__init__.py']:
|
||||||
|
return None
|
||||||
|
if not info['module']:
|
||||||
|
return None
|
||||||
|
filename = info['module'].replace('.', '/')
|
||||||
|
return "https://github.com/illiumst/marl-factory-grid/%s.py" % filename
|
||||||
|
|
||||||
|
autoclass_content = 'both'
|
||||||
|
|||||||
@@ -20,6 +20,13 @@ class FactoryConfigParser(object):
|
|||||||
default_observations = [c.WALLS, c.AGENT]
|
default_observations = [c.WALLS, c.AGENT]
|
||||||
|
|
||||||
def __init__(self, config_path, custom_modules_path: Union[PathLike] = None):
|
def __init__(self, config_path, custom_modules_path: Union[PathLike] = None):
|
||||||
|
"""
|
||||||
|
This class parses the factory env config file.
|
||||||
|
|
||||||
|
|
||||||
|
:param config_path: Test
|
||||||
|
:param custom_modules_path: Test
|
||||||
|
"""
|
||||||
self.config_path = Path(config_path)
|
self.config_path = Path(config_path)
|
||||||
self.custom_modules_path = Path(custom_modules_path) if custom_modules_path is not None else custom_modules_path
|
self.custom_modules_path = Path(custom_modules_path) if custom_modules_path is not None else custom_modules_path
|
||||||
self.config = yaml.safe_load(self.config_path.open())
|
self.config = yaml.safe_load(self.config_path.open())
|
||||||
|
|||||||
Reference in New Issue
Block a user