Skip to content

Commit

Permalink
Merge pull request #677 from veselypeta/petr/592/add-macros-to-api-li…
Browse files Browse the repository at this point in the history
…sting

[UR] Add macro definitions to API Listing documentation
  • Loading branch information
veselypeta authored Jul 4, 2023
2 parents 2eae79a + f4cea52 commit ac100b9
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions scripts/templates/api_listing.mako
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,54 @@ ${title}
%endif
%endfor # obj in objects
#################################################################
## -------------------------
## Macros
## -------------------------
<%isempty = True%>
<%seen = list() %>
%for obj in objects:
%if re.match(r"macro", obj['type']):
%if obj['name'] in seen:
<% continue %>
%else:
<% seen.append(obj['name'])%>
%endif
%if isempty: # only display section title if there is content.
%if needstitle:
<%needstitle = False%>
${title}
============================================================
%endif
* Macros
<%isempty = False%>
%endif
* :ref:`${th.make_type_name(n, tags, obj).replace("_", "-")}`
%endif
%endfor # obj in objects
#################################################################
## -------------------------
## Typedefs
## -------------------------
<%isempty = True%>
%for obj in objects:
%if re.match(r"typedef", obj['type']):
%if isempty: # only display section title if there is content.
%if needstitle:
<%needstitle = False%>
${title}
============================================================
%endif
* Typedefs
<%isempty = False%>
%endif
* :ref:`${th.make_type_name(n, tags, obj).replace("_", "-")}`
%endif
%endfor # obj in objects
#################################################################
## Generate API documentation
#################################################################
Expand Down Expand Up @@ -159,6 +207,59 @@ ${th.make_type_name(n, tags, obj)}
:project: UnifiedRuntime
%endif
%endif
%endfor # obj in objects
#################################################################
## -------------------------
## Macros
## -------------------------
<%isempty = True%>
<%seen = list() %>
%for obj in objects:
%if not re.match(r"macro", obj['type']):
<% continue %>
%endif # macro
%if obj['name'] in seen:
<% continue %>
%else:
<% seen.append(obj['name']) %>
%endif
%if isempty:
${title} Macros
--------------------------------------------------------------------------------
<%isempty = False%>
%endif # isempty
.. _${th.make_type_name(n, tags, obj).replace("_", "-")}:
${th.make_type_name(n, tags, obj)}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygendefine:: ${th.make_type_name(n, tags, obj)}
:project: UnifiedRuntime
%endfor # obj in objects
#################################################################
## -------------------------
## Typedefs
## -------------------------
<%isempty = True%>
%for obj in objects:
%if re.match(r"typedef", obj['type']):
%if isempty: # only display section title if there is content.
${title} Structures
--------------------------------------------------------------------------------
<%isempty = False%>
%endif
.. _${th.make_type_name(n, tags, obj).replace("_", "-")}:
${th.make_type_name(n, tags, obj)}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. doxygentypedef:: ${th.make_type_name(n, tags, obj)}
:project: UnifiedRuntime
%endif
%endfor # obj in objects
Expand Down

0 comments on commit ac100b9

Please sign in to comment.