From b672ebca886dd6dc9b0f775eb769764750fd302c Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Mon, 4 Oct 2021 19:39:36 +0200 Subject: Minor fixups --- docs/refman/generatormd.py | 4 +++- docs/refman/templates/root.mustache | 13 ++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'docs/refman') diff --git a/docs/refman/generatormd.py b/docs/refman/generatormd.py index 704ca3b..abf8a99 100644 --- a/docs/refman/generatormd.py +++ b/docs/refman/generatormd.py @@ -156,7 +156,9 @@ class GeneratorMD(GeneratorBase): return ' | '.join([data_type_to_str(x) for x in typ.resolved]) def len_stripped(s: str) -> int: - return len(re.sub(r'<[^>]+>', '', s)) + s = s.replace(']]', '') + # I know, this regex is ugly but it works. + return len(re.sub(r'\[\[(#|@)*([^\[])', r'\2', s)) def render_signature() -> str: # Skip a lot of computations if the function does not take any arguments diff --git a/docs/refman/templates/root.mustache b/docs/refman/templates/root.mustache index b62a6f6..cd846ac 100644 --- a/docs/refman/templates/root.mustache +++ b/docs/refman/templates/root.mustache @@ -11,7 +11,7 @@ and methods are documented in detail in the following subpages: ## Elementary types {{#elementary}} -{{>root_link}} +{{indent}}- {{&link}} {{/elementary}} ## Functions @@ -21,7 +21,7 @@ to see the description and usage. The objects returned by them are [listed here](#returned-objects). {{#functions}} -{{>root_link}} +{{indent}}- {{&link}} {{/functions}} ## Builtin objects @@ -29,7 +29,7 @@ to see the description and usage. The objects returned by them are These are built-in objects that are always available. {{#builtins}} -{{>root_link}} +{{indent}}- {{&link}} {{/builtins}} ## Returned objects @@ -38,11 +38,14 @@ These are objects that can be returned by [functions](#functions) or other methods. {{#returned}} -{{>root_link}} +{{indent}}- {{&link}} {{/returned}} ## Modules {{#modules}} -{{>root_link}} +{{indent}}- {{&link}} {{/modules}} + + + -- cgit v1.1