API Reference¶
mkdocs_rsoxs
¶
mkdocs_rsoxs package.
__version__ = '0.1.3'
module-attribute
¶
extensions
¶
codexec
¶
CodexecBlock
¶
Bases: Block
on_create(parent)
¶
Called when a block is initially found and initialized. The on_create method should create the container for the block under the parent element. Other child elements can be created on the root of the container, but outer element of the created container should be returned.
Source code in src/mkdocs_rsoxs/extensions/codexec.py
on_end(block)
¶
When a block is parsed to completion, the on_end event is executed. This allows an extension to perform any post processing on the elements. You could save the data as raw text and then parse it special at the end or you could walk the HTML elements and move content around, add attributes, or whatever else is needed.
Source code in src/mkdocs_rsoxs/extensions/codexec.py
echarts
¶
alpha
¶
EchartsBlock
¶
Bases: Block
on_create(parent)
¶Called when a block is initially found and initialized. The on_create method should create the container for the block under the parent element. Other child elements can be created on the root of the container, but outer element of the created container should be returned.
Source code in src/mkdocs_rsoxs/extensions/echarts/alpha.py
on_add(block)
¶When any calls occur to process new content, on_add is called. This gives the block a chance to return the element where the content is desired.
Source code in src/mkdocs_rsoxs/extensions/echarts/alpha.py
on_end(block)
¶When a block is parsed to completion, the on_end event is executed. This allows an extension to perform any post processing on the elements. You could save the data as raw text and then parse it special at the end or you could walk the HTML elements and move content around, add attributes, or whatever else is needed.
Source code in src/mkdocs_rsoxs/extensions/echarts/alpha.py
filters
¶
parse_author(site_author)
¶
Returns the email address of the site author.
Source code in src/mkdocs_rsoxs/filters.py
active_section(nav)
¶
Return the top-level active section
first_page(section)
¶
Return the first page in a section
Source code in src/mkdocs_rsoxs/filters.py
file_exists(path, config)
¶
Return whether path exists under docs_dir or the active theme static dirs.
Source code in src/mkdocs_rsoxs/filters.py
is_http_url(path)
¶
Check if a path is a valid URL (http, https and also data scheme)
Source code in src/mkdocs_rsoxs/filters.py
jinja_plugin
¶
plugins
¶
excalidraw
¶
ExcalidrawPlugin()
¶
Bases: RouterMixin, BasePlugin[ExcalidrawPluginConfig]
This plugin enabled the real time edition of excalidraw scenes in development mode
Source code in src/mkdocs_rsoxs/plugins/_router.py
is_dev_server = False
class-attribute
instance-attribute
¶
Internal flag to detect if we are in development mode.
bottle = Bottle()
instance-attribute
¶
We use bottle to handle plugin routes since
its wsgi() method is very convenient with regards to
the _serve_request() method of the mkdocs dev server
on_startup(*, command, dirty)
¶
Detect if the server is running in development mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
str
|
the command being run (e.g., "serve" or "build") |
required |
dirty
|
bool
|
whether the site is dirty (i.e., needs to be rebuilt) |
required |
Source code in src/mkdocs_rsoxs/plugins/excalidraw.py
on_config(config, **kwargs)
¶
Three operations are performed:
- detect and create the excalidraw directory
- load the internal excalidraw markdown extension
- inject the HTTP routes needed to handle excalidraw scenes and SVGs
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
MkDocsConfig
|
MkDocs configuration object. |
required |
Source code in src/mkdocs_rsoxs/plugins/excalidraw.py
add_route(path, handler, method='GET')
¶
extend_server(server)
¶
Extend the mkdocs dev server to add custom behavior.
Source code in src/mkdocs_rsoxs/plugins/_router.py
on_serve(server, /, *, config, builder)
¶
This method is called when the server is started. At the end of the mkdocs workflow. At this moment we have access to the live server to inject our new routes. See https://www.mkdocs.org/dev-guide/plugins/#events to see the mkdocs workflow.
Source code in src/mkdocs_rsoxs/plugins/_router.py
svg_handler_factory(directory)
¶
Attributes:
| Name | Type | Description |
|---|---|---|
directory |
str
|
Directory where the SVG files are stored. This is relative to the docs_dir. |
Source code in src/mkdocs_rsoxs/plugins/excalidraw.py
mixins
¶
dev
¶
git
¶
GitTimestampsMixin
¶
Bases: Mixin
on_config(config)
¶Called when the config is loaded.
Attributes:
| Name | Type | Description |
|---|---|---|
config |
dict
|
The MkDocs configuration dictionary. |
Source code in src/mkdocs_rsoxs/plugins/mixins/git.py
find_repo(abs_src_file)
¶
Find the git repository for the given source file. Returns None if no repository is found.
Source code in src/mkdocs_rsoxs/plugins/mixins/git.py
markdown
¶
order
¶
OrderMixin
¶
Bases: Mixin
page_index = 0
class-attribute
instance-attribute
¶Internal page index for orderning purpose
page_indices = set()
class-attribute
instance-attribute
¶Internal set of pages that have hard-coded order
nav_order = []
class-attribute
instance-attribute
¶Internal list of pages in the order they appear in the navigation
on_files(files, config)
¶Remove order from file destination URI, to get nicer URLs.
Source code in src/mkdocs_rsoxs/plugins/mixins/order.py
table
¶
TableMixin
¶
Bases: Mixin
A mixin to wrap
| Name | Type | Description | Default |
|---|---|---|---|
base
|
MutableMapping
|
the dictionary to merge into (modified in place) |
required |
override
|
Mapping
|
the dictionary to merge from (not modified) |
required |