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

docs: backlinks from example manifests to guides #1177

Merged

Commits on May 31, 2022

  1. mkdocs: enable "line-based comments"

    We would like our example YAML files to include comments that do not
    show up in the guides where the files are used as jinja templates,
    while still ensuring they are valid YAML files.
    
    Configuring the jinja Environment with "line_comment_prefix" allows
    you to control the syntax of the jinja comment directive. If we set
    that to "##", then such lines are ommitted during jinja templating,
    and are treated as YAML comments.
    
    See also
    https://jinja.palletsprojects.com/en/2.11.x/templates/#line-statements
    markmc committed May 31, 2022
    Configuration menu
    Copy the full SHA
    9d9a10f View commit details
    Browse the repository at this point in the history
  2. docs: backlinks from example manifests to guides

    Add Jinja "line comments" to our example manifests which reference the
    guides which use them.
    
    Generated using this awfulness:
    
    $ sed -i '1s/^/## Used in:\n/' $( \
        for iii in $(git grep -l '{% include' site-src/); do \
          awk -F "'" '/{% include/ { print "examples/"$2 }' $iii ; \
        done | sort | uniq)
    
    $ for iii in $(git grep -l '{% include' site-src/); do \
        for jjj in $(awk -F "'" '/{% include/ { print "examples/"$2 }' $iii); do \
          sed -i "2s|^|## - $iii\n|" $jjj; \
        done; \
      done
    
    Co-authored-by: Mark McLoughlin <[email protected]>
    kundan2707 and markmc committed May 31, 2022
    Configuration menu
    Copy the full SHA
    6fb5439 View commit details
    Browse the repository at this point in the history