Skip to content

Commit def35eb

Browse files
committed
a little cleanup; should be ready for review
1 parent d3567cc commit def35eb

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

paths_cli/compiling/_gendocs/config_handler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from collections import namedtuple
22
from paths_cli.commands.compile import select_loader
33

4-
DocCategoryInfo = namedtuple('DocCategoryInfo', ['header', 'description'],
5-
defaults=[None])
4+
DocCategoryInfo = namedtuple('DocCategoryInfo', ['header', 'description',
5+
'type_required'],
6+
defaults=[None, True])
67

78

89
def load_config(config_file):

paths_cli/compiling/_gendocs/docs_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from .config_handler import DocCategoryInfo
55

66
PARAMETER_RST = """* **{p.name}**{type_str} - {p.description}{required}\n"""
7-
# TODO: add templates here instead of adding up strings in the code
87

98

109
class DocsGenerator:
@@ -37,7 +36,7 @@ def _get_cat_info(self, category_plugin):
3736
cat_info = DocCategoryInfo(category_plugin.label)
3837
return cat_info
3938

40-
def generate_category_rst(self, category_plugin, type_required=True):
39+
def generate_category_rst(self, category_plugin):
4140
"""Generate the RST for a given category plugin.
4241
4342
Parameters
@@ -52,6 +51,7 @@ def generate_category_rst(self, category_plugin, type_required=True):
5251
"""
5352
# TODO: move type_required to DocCategoryInfo (default True)
5453
cat_info = self._get_cat_info(category_plugin)
54+
type_required = cat_info.type_required
5555
rst = f".. _compiling--{category_plugin.label}:\n\n"
5656
rst += f"{cat_info.header}\n{'=' * len(str(cat_info.header))}\n\n"
5757
if cat_info.description:

0 commit comments

Comments
 (0)