-
Notifications
You must be signed in to change notification settings - Fork 68
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
parent-context doesn't not work properly in deeper structures #71
Comments
This would be a question primarily for @mrksu , but as his accomplice in doing this, I am sure this is indeed broken and your analysis is correct. In fact it confirms a doubt I had a few weeks earlier. (Curious that nobody ran into this, including me...) The actual reason for doing this "parent-context" dance is that the "context" variable is global, too, and including a sub-assembly within an assembly messes context up: If the sub-assembly is followed by a module, the module gets wrong context. An alternative approach is that in every file where there is an include::assembly followed by include::module, one must insert in between them a line setting context to the right value. It is not as neat and automatic, but works. Sorry for brevity-hopefully it is understandable. Asciidoc being what it is, it lacks variable scopes or stack-like structures, which leads me to believe an automated solution is not possible. We (Marek and I) agreed on proposing this solution, believing the stacking would happen automatically. Apparently it does not. (PS: Do we need context to agree with the assembly? It is the sole reason to have this whole context and parent-context complication.) |
Setting the context again after each assembly include seems quite strange. But as I said - my workaround was removing all Of course having local variables in Asciidoc would be great, but I assume that is not a realistic option. BTW: This is an actual problem we run into in our docs. The two examples are just for demonstration. Maybe nobody else run into this yet because of using more flat document structures. |
This was how I was doing it on the project @scholzj mentioned originally but I thought it seemed strange to repeat it over and over so I stopped doing that. |
Hi, sorry for replying so late. As the person who invented the The problem is that the The For example, if there's an assembly called "Creating a backup", its ID would be I'm actively using this solution and I haven't found any problems with it. I'm planning on merging the templates used internally by [1] https://github.com/redhat-documentation/tools/tree/master/newdoc |
@mrksu Thanks. I will try the |
@scholzj Personally, I'd say it's useful to keep this issue open until I actually "merge" the two projects (enabling |
No, its fine to keep it open. Thanks. |
@mrksu - Conducting a review of outstanding issues in this repo, and checking in to see if this issue can now be closed. |
I'll open by saying that whatever the solution, please update the Mod Docs reference guide. Now...I'm running into a problem with parent-context...not sure if it's the same one noted here. But I noticed that the solution in the Mod Docs reference guide defines parent-context, but never undefines it. So I restructured the code a bit like this:
Notice that I put the |
FYI, we ran into a similar problem in RHOSP and it turned out that we needed to set the :context: variable in the book/guide main assembly. This wasn't documented in the Mod Docs Reference Guide, and there is no template for master.adoc files so we had to scramble our own template for the team. I'll be happy to add this information to the reference guide and work with someone who's more experienced with templates to create a book-level template, if this is indeed the best practice we want to implement across the teams. |
We tried to follow this documentation and use the templates for documentation in our project Strimzi. However, we have run into problems with the assembly template. The template suggests that on the beginning of every assembly, we should save the parent context:
And restore it at the end of every assembly.:
However, the template suggests that every assembly should use the same variable
parent-context
. And this works only on a very flat structure. Once you change the context on two levels you can very easily mess up the context for all the upper levels because the original context will be never restores.As an example, you can check these two samples:
Just check these out and open them in your editor / render them and you will see how the context is never restored properly.
So far the solution we used in our docs was:
parent-context
Can you please clarify if we are using it incorrectly or if it is a bug?
The text was updated successfully, but these errors were encountered: