Experimenting with variations in recommonmark

This commit is contained in:
Griatch 2020-05-25 22:28:43 +02:00
parent a6cc46d15c
commit f228a23b12
4 changed files with 29 additions and 24 deletions

View file

@ -52,17 +52,17 @@ _CUSTOM_LINK_REMAP = {
}
_LINK_SKIP = (
"[5](Win)", "[6](Win)", "[7](Win)", "[10](Win)", "[11](Mac)", "[13](Win)",
"[14](IOS)", "[15](IOS)", "[16](Andr)", "[17](Andr)", "[18](Unix)",
"[21](Chrome)",
"[5](Win)", "[6](Win)", "[7](Win)", "[10](Win)", "[11](Mac)", "[13](Win)",
"[14](IOS)", "[15](IOS)", "[16](Andr)", "[17](Andr)", "[18](Unix)",
"[21](Chrome)",
# these should be checked
"[EvTable](EvTable)",
"[EvTable](EvTable)",
"[styled](OptionStyles)",
"[Inputfunc](Inputfunc)",
"[Inputfunc](Inputfunc)",
"[API](evennia)",
"[online documentation wiki](index)",
"[online documentation](index)",
"[Home](index)",
"[online documentation wiki](index)",
"[online documentation](index)",
"[Home](index)",
"[Accounts](Account)",
"[Session](Session)",
"[Inputfuncs](Inputfunc)",
@ -150,5 +150,5 @@ def convert_links(files, outdir):
if __name__ == "__main__":
create_toctree(_INFILES)
convert_links(_INFILES, _OUTDIR)
convert_links(_INFILES, _OUTDIR)

View file

@ -117,9 +117,9 @@ autodoc_default_options = {
"undoc-members": True,
"show-inheritance": True,
"special-members": "__init__",
"enable_eval_rst": True,
}
def autodoc_skip_member(app, what, name, obj, skip, options):
if _no_autodoc:
return True
@ -128,6 +128,7 @@ def autodoc_skip_member(app, what, name, obj, skip, options):
return False
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
@ -148,25 +149,28 @@ smv_outputdir_format = "versions" + sep + "{config.release}"
_github_code_root = "https://github.com/evennia/tree/master/"
_github_doc_root = "https://github.com/evennia/tree/master/docs/sources/"
# recommonmark
def url_resolver(url):
if url.startswith("github:"):
return _github_code_root + url[7:]
elif url.startswith("api:"):
return f"api/{url[4:]}.rst"
else:
return _github_doc_root + url
# dynamic setup
auto_toc_sections = ["Contents", "Toc", "Index"]
recommonmark_config = {
"enable_auto_doc_ref": True,
"enable_auto_toc_tree": True,
"url_resolver": url_resolver,
"auto_toc_tree_section": ["Contents", "Toc", "Index"],
}
def setup(app):
app.connect("autodoc-skip-member", autodoc_skip_member)
app.add_config_value('recommonmark_config', {
'url_resolver': url_resolver,
'auto_toc_tree_section': auto_toc_sections,
}, True)
app.add_transform(AutoStructify)
# custom lunr-based search

View file

@ -15,12 +15,12 @@ There is [a lengthier introduction](Evennia-Introduction) to read. You might als
|-----------------|----------------------|--------------------------|----------------------|----------------------------|--------------------|
|[Getting Started](Getting-Started)| [Admin Docs](Administrative-Docs) | [Builder Docs](Builder-Docs) | [Developer Central](Developer-Central) | [Tutorials & Examples](Tutorials) | [API](evennia) |
- The [Getting Started](Getting-Started) page helps installing and starting Evennia for the first time.
- The [Admin Docs](Administrative-Docs) covers running and maintaining an Evennia server.
- The [Builder Docs](Builder-Docs) helps for starting to build a game world using Evennia.
- The [Developer Central](Developer-Central) describes how Evennia works and is used by coders.
- The [Tutorials & Examples](Tutorials) contains help pages on a step-by-step or tutorial format.
- The [API](evennia) documentation is created from the latest source code.
- [Getting Started](Getting-Started) page helps installing and starting Evennia for the first time.
- [Admin Docs](Administrative-Docs) covers running and maintaining an Evennia server.
- [Builder Docs](Builder-Docs) helps for starting to build a game world using Evennia.
- [Developer Central](Developer-Central) describes how Evennia works and is used by coders.
- [Tutorials & Examples](Tutorials) contains help pages on a step-by-step or tutorial format.
- [API](api:evennia) documentation is created from the latest source code.
[search]: https://www.google.com/cse/publicurl?cx=010440404980795145992:6ztkvqc46je
[group]: https://groups.google.com/forum/#%21forum/evennia

View file

@ -1,5 +1,6 @@
# Toc
* [index](index.md)
* [A voice operated elevator using events](A-voice-operated-elevator-using-events.md)
* [API refactoring](API-refactoring.md)
* [Accounts](Accounts.md)
@ -136,4 +137,4 @@
* [Webclient brainstorm](Webclient-brainstorm.md)
* [Webclient](Webclient.md)
* [Wiki Index](Wiki-Index.md)
* [Zones](Zones.md)
* [Zones](Zones.md)