diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-05-12 14:05:05 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-05-12 21:04:47 +0200 |
commit | 0174da56742c82322d5c04167bf76b217903247d (patch) | |
tree | 966c54529e3434761cb09d992e5d25ffae217656 /rtemsspec/sphinxcontent.py | |
parent | modules: Update rtems-docs (diff) | |
download | rtems-central-0174da56742c82322d5c04167bf76b217903247d.tar.bz2 |
content: Improve plural of terms
Diffstat (limited to 'rtemsspec/sphinxcontent.py')
-rw-r--r-- | rtemsspec/sphinxcontent.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/rtemsspec/sphinxcontent.py b/rtemsspec/sphinxcontent.py index 5e530ff3..1d72ae7c 100644 --- a/rtemsspec/sphinxcontent.py +++ b/rtemsspec/sphinxcontent.py @@ -27,7 +27,8 @@ from contextlib import contextmanager from typing import Any, Iterable, Iterator, List, Optional, Sequence, Union -from rtemsspec.content import Content, make_lines, to_camel_case +from rtemsspec.content import Content, get_value_plural, make_lines, \ + to_camel_case from rtemsspec.items import Item, ItemGetValue, ItemGetValueContext, ItemMapper GenericContent = Union[str, List[str], "Content"] @@ -203,10 +204,7 @@ def _get_ref_term(ctx: ItemGetValueContext) -> Any: def _get_ref_term_plural(ctx: ItemGetValueContext) -> Any: - try: - return f":term:`{ctx.value[ctx.key]} <{ctx.value['term']}>`" - except KeyError: - return f":term:`{ctx.value['term']}s <{ctx.value['term']}>`" + return f":term:`{get_value_plural(ctx)} <{ctx.value['term']}>`" def _get_appl_config_option(ctx: ItemGetValueContext) -> Any: |