Skip to content

Commit

Permalink
jinja template to create a readme file for a template
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Fiers committed Sep 21, 2012
1 parent db4dadd commit 93ddf5d
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions lib/jinja2/template.readme.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Title: template "{{ t.moa_id }}"
Category: template

{% macro printpar(p) -%}
{{ p }}
: {% if t.parameters[p].help -%}
{{t.parameters[p].help}}
{%- else -%}
*(no help provided)*
{%- endif %}

*type: *
{%- if t.parameters[p]['type'] -%}
{{ t.parameters[p].type }}
{%- else -%}
String
{%- endif %}<br>
optional: {%- if t.parameters[p]['optional'] == True %}yes{% else %}no{% endif %}

{% endmacro -%}
{%- macro printfs(f) -%}
{{ f }}
: {% if t.filesets[f].help -%}
{{ t.filesets[f].help }}
{%- else -%}
*(no help provided)*
{%- endif %}

*type:* {{ t.filesets[f].type }}<br>
*category:* {{ t.filesets[f].category }}<br>
*optional:* {% if t.filesets[f].optional %}yes{% else %}no{% endif %}

{% endmacro %}

### Description

{{ t.description }}

### Filesets

{% for p in t.filesets -%}
{{ printfs(p) }}
{%- endfor %}

### Parameters

{% for p in t.parameters -%}
{%- if p[0] != "_" and p[:4] != "moa" %}{{printpar(p)}}{% endif %}
{%- endfor %}

### Private parameters

{% for p in t.parameters -%}
{%- if p[0] == "_" or p[:4] != "moa" %}{{printpar(p)}}{% endif %}
{%- endfor %}

### General

* Author: {{ t.author }}
* Backend: {{ t.backend }}
*

0 comments on commit 93ddf5d

Please sign in to comment.