Dynamic setting of header markup
As the top level header in index.rst and get_started.rst depends on cookiecutter.service the length of the header markups should also depend on the length of cookiecutter.service. Unfortunatelly I was not able to figure out how to include the macro from a different template, so there is a copy-paste there. Change-Id: Iff2255f10690f23de270b84c1bd0cd7de3c611a3 Signed-off-by: csatari <gergely.csatari@nokia.com>
This commit is contained in:
parent
0b20c8bf29
commit
7bdd14ad52
|
@ -1,7 +1,13 @@
|
||||||
=========================
|
{%- macro set_header_markup(header_text_length) -%}
|
||||||
{{cookiecutter.service}} service overview
|
{%- set servicelength = cookiecutter.service|length -%}
|
||||||
=========================
|
{%- for _ in range(0, servicelength + header_text_length) -%}={%- endfor -%}
|
||||||
|
{%- endmacro -%}
|
||||||
|
{%- macro set_header(header_text) -%}
|
||||||
|
{{ set_header_markup(header_text|length) }}
|
||||||
|
{{cookiecutter.service}}{{header_text}}
|
||||||
|
{{ set_header_markup(header_text|length) }}
|
||||||
|
{%- endmacro -%}
|
||||||
|
{{ set_header(" service overview") }}
|
||||||
The {{cookiecutter.service}} service provides...
|
The {{cookiecutter.service}} service provides...
|
||||||
|
|
||||||
The {{cookiecutter.service}} service consists of the following components:
|
The {{cookiecutter.service}} service consists of the following components:
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
=====================
|
{%- macro set_header_markup(header_text_length) -%}
|
||||||
{{cookiecutter.service}} service
|
{%- set servicelength = cookiecutter.service|length -%}
|
||||||
=====================
|
{%- for _ in range(0, servicelength + header_text_length) -%}={%- endfor -%}
|
||||||
|
{%- endmacro -%}
|
||||||
|
{%- macro set_header(header_text) -%}
|
||||||
|
{{ set_header_markup(header_text|length) }}
|
||||||
|
{{cookiecutter.service}}{{header_text}}
|
||||||
|
{{ set_header_markup(header_text|length) }}
|
||||||
|
{%- endmacro -%}
|
||||||
|
{{ set_header(" service") }}
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
|
|
Loading…
Reference in New Issue