DOCUMENTATION: LaTeX template is back

ongoing work for the Booklet
pull/1648/head
Jan-Piet Mens 12 years ago
parent f1f44843c3
commit afa467e975

@ -259,8 +259,8 @@ def main():
env.filters['jpfunc'] = latex_ify env.filters['jpfunc'] = latex_ify
template = env.get_template('latex.j2') template = env.get_template('latex.j2')
outputname = "%s.tex" outputname = "%s.tex"
includecmt = "% generated code\n" includecmt = ""
includefmt = "\\input %s\n" includefmt = "%s\n"
if options.type == 'html': if options.type == 'html':
env.filters['jpfunc'] = html_ify env.filters['jpfunc'] = html_ify
template = env.get_template('html.j2') template = env.get_template('html.j2')

@ -0,0 +1,76 @@
{# -------------------------------------------------------------------
template for module_formatter.py for LaTeX output (Ansible Booklet)
by Jan-Piet Mens.
Note: nodes & code examples are omitted on purpose.
-------------------------------------------------------------------- #}
%--- @{ module | upper }@ ---- from @{ filename }@ ---
%: -- module header
\mods{@{module}@}{@{docuri}@}{
{% for desc in description -%}
@{ desc | jpfunc }@
{% endfor -%}
{% if version_added is defined -%}
(\I{* new in version @{ version_added }@})
{% endif -%}
}
%: -- module options
{% if options %}
\begin{xlist}{abcdefghijklmno}
{% for (opt,v) in options.iteritems() %}
{% if v['required'] %}
\item[\man\,\C{@{ opt }@}]
{% else %}
\item[\opt\,\C{@{ opt }@}]
{% endif %}
{# -------- option description ----------#}
{% for desc in v.description %}
@{ desc | jpfunc }@
{% endfor %}
{% if v['choices'] %}
\B{Choices}:\,
{% for choice in v['choices'] %}\C{@{ choice }@}{% if not loop.last %},{% else %}.{% endif %}
{% endfor %}
{% endif %}
{% if v['default'] %}
(default \C{@{ v['default'] }@})
{% endif %}
{% if v['version_added'] is defined %}
(\I{* version @{ v['version_added'] }@})
{% endif %}
{% endfor %}
\end{xlist}
{% endif %}
{# ---------------------------------------
{% if notes %}
{% for note in notes %}
\I{@{ note | jpfunc }@}
{% endfor %}
{% endif %}
----------------------------- #}
{#-------------------------------------------
{% if examples is defined -%}
{% for e in examples %}
\begin{extymeta}
@{ e['code'] }@
\end{extymeta}
{% endfor %}
{% endif %}
----------------------------------- #}
{% if extradata is defined %}
%--- BEGIN-EXTRADATA
\begin{extymeta}
@{ extradata }@
\end{extymeta}
%----- END-EXTRADATA
{% endif %}
Loading…
Cancel
Save