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

Add substitution strings for the templates to be directly usable by the newdoc script #83

Closed
wants to merge 1 commit into from

Conversation

msuchane
Copy link
Contributor

This PR edits template files so that they have machine-readable substitution strings in the format of the Python Template module. This makes it possible for the newdoc[1] script to download templates each time a file is generated to make sure writers always have the most up-to-date version.

Bits that have been changed:

  • The module/assembly title
  • The module/assembly ID
  • Context-related attributes

Additionally, this PR changes the parent-context attribute to be assembly-specific: parent-context-of-(assembly-ID). The attribute is composed automatically by newdoc when creating a new file. The reasoning is explained in issue#71, which is fixed with this change.

[1] https://github.com/redhat-documentation/tools/tree/master/newdoc

[id='a-collection-of-modules']
// If the assembly is reused in other assemblies in a guide, include {context} in the ID: [id='a-collection-of-modules-{context}'].
= A collection of modules
[id='${module_id}']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure here: Do we want to default to assembly IDs having context or not? Alternatively, should I add an ifdef statement to take care of the two scenarios automatically?

@msuchane
Copy link
Contributor Author

I must admit, I feel like the substitution strings make it harder for human eyes to make sense of the templates, and they were complicated enough before I started with this.

On the other hand, if the templates are to be usable for automatic generators, which makes working with them much easier, certain parts must be unambiguous for computers, which probably means using some sort of additional markup or programming language syntax like I have used.

@ritz303 ritz303 closed this Oct 1, 2019
@ritz303
Copy link
Contributor

ritz303 commented Oct 1, 2019

A lot has changed since this PR was submitted, so I'm closing this PR.

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

Successfully merging this pull request may close these issues.

2 participants