Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: support for extracting documentation from templates #1

Closed
drybjed opened this issue May 27, 2015 · 2 comments
Closed

Comments

@drybjed
Copy link
Member

drybjed commented May 27, 2015

Ansible roles have templates in random places which are written in Jinja2. Jinja2 provides a way to add comments to the templates which are not rendered, for example:

{# This won't be rendered #}

I would like to document these templates using reStructuredText inside these comment sections, but to not have random sections extracted, that would require a top and bottom marker to tell yaml2rst which section of the file to extract and convert, for example:

{#
# =====yaml2rst-top=====
# .. _postfix_template_main_cf:
# Postfix template: /etc/postfix/main.cf
# ======================================
# =====yaml2rst-bottom=====
#}

With this formatting, yaml2rst could grab the specified file, cut the not selected parts from top and bottom, and convert the rest to RST. Having these markers configurable would be a bonus.

[Edit by htgoebel: Split into two issues, see #2]

@htgoebel
Copy link
Collaborator

IMHO this should go into a separate tool jinja2rst. I'll put that on my todo list.

@htgoebel
Copy link
Collaborator

htgoebel commented Jun 1, 2015

jinja2rst is written and now available in PyPI.

@htgoebel htgoebel closed this as completed Jun 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants