From 12edb026aef7d47c11339a58df9c1784117bbfda Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 7 May 2021 13:45:01 +0200 Subject: applconfig: Use unspecified groups --- rtemsspec/sphinxcontent.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'rtemsspec/sphinxcontent.py') diff --git a/rtemsspec/sphinxcontent.py b/rtemsspec/sphinxcontent.py index 5ebf5287..7b6a257d 100644 --- a/rtemsspec/sphinxcontent.py +++ b/rtemsspec/sphinxcontent.py @@ -248,6 +248,15 @@ def _get_value_sphinx_unspecified_function(ctx: ItemGetValueContext) -> Any: return _get_value_sphinx_ref(ctx, _get_value_sphinx_function, "()") +def _get_value_sphinx_unspecified_group(ctx: ItemGetValueContext) -> Any: + if "c-user" in ctx.item["references"]: + return f":ref:`{ctx.item['references']['c-user']}`" + if "url" in ctx.item["references"]: + url = ctx.item["references"]["url"] + return f"`{ctx.value[ctx.key]}{postfix} <{url}>`_" + return ctx.value[ctx.key] + + def _get_value_sphinx_unspecified_type(ctx: ItemGetValueContext) -> Any: return _get_value_sphinx_ref(ctx, _get_value_sphinx_type, "") @@ -280,6 +289,8 @@ class SphinxMapper(ItemMapper): _get_value_sphinx_unspecified_define) self.add_get_value("interface/unspecified-function:/name", _get_value_sphinx_unspecified_function) + self.add_get_value("interface/unspecified-group:/name", + _get_value_sphinx_unspecified_group) self.add_get_value("interface/unspecified-type:/name", _get_value_sphinx_unspecified_type) -- cgit v1.2.3