deepmodeling_sphinx package

deepmodeling_sphinx.setup(app: Sphinx) Dict[str, Any][source]

Submodules

deepmodeling_sphinx.authors module

A directive to list all authors from git-shortlog.

class deepmodeling_sphinx.authors.AuthorsDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)[source]

Bases: SphinxDirective

authors directive.

Attributes:
config

Reference to the Config object.

env

Reference to the BuildEnvironment object.

Methods

add_name(node)

Append self.options['name'] to node['names'] if it exists.

assert_has_content()

Throw an ERROR-level DirectiveError if the directive doesn't have contents.

directive_error(level, message)

Return a DirectiveError suitable for being thrown as an exception.

get_location()

Get current location info for logging.

get_source_info()

Get source and line number.

run()

Run directive.

set_source_info(node)

Set source and line number to the node.

debug

error

info

severe

warning

has_content = False

May the directive have content?

option_spec = {}

Mapping of option names to validator functions.

run()[source]

Run directive.

deepmodeling_sphinx.authors.get_authors() Iterator[str][source]

Yields authors from git-shortlog.

Yields:
str

Author name.

deepmodeling_sphinx.authors.git_shortlog() str[source]

Return git-shortlog output as a string.

Returns:
str

Git-shortlog output.

deepmodeling_sphinx.authors.setup(app: Sphinx) Dict[str, Any][source]

deepmodeling_sphinx.config module

deepmodeling_sphinx.inject module

deepmodeling_sphinx.inject.copy_custom_files(app)[source]
deepmodeling_sphinx.inject.enable_dark_mode(app, config)[source]

Enable dark mode if the theme is sphinx_rtd_theme.

deepmodeling_sphinx.inject.insert_icp(app, pagename, templatename, context, doctree)[source]
deepmodeling_sphinx.inject.insert_sidebar(app, pagename, templatename, context, doctree)[source]
deepmodeling_sphinx.inject.minify_css_files(app, exception)[source]
deepmodeling_sphinx.inject.minify_html_files(app, pagename, templatename, context, doctree)[source]
deepmodeling_sphinx.inject.minify_js_files(app, exception)[source]
deepmodeling_sphinx.inject.render_banner(current_site='Docs') str[source]

Use jinja2 to render banner.

Returns:
str

HTML content of banner.

deepmodeling_sphinx.inject.setup(app: Sphinx) Dict[str, Any][source]