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
Updating Upstream snippets to workaround Downstream-tooling incapacitates with multiple-snippet bars #32263
Conversation
|
Spot some replacements googledocs are doing to the original markup (oh bother, fixing). One sec |
c94aeb0
to
009989e
Compare
|
@gsmet Hello Guillaume. Can I ask you for a check? Builds correctly (local builds) |
|
🙈 The PR is closed and the preview is expired. |
009989e
to
3957951
Compare
3957951
to
e1ad3bd
Compare
d5f9337
to
9aaa5bb
Compare
| @@ -55,4 +55,8 @@ | |||
| // . | |||
| :create-app-group-id: org.acme | |||
| // . | |||
| // Devtools snippet's attribute and context | |||
| :upstream: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather not use upstream/downstream, as we discussed. This PR is specifically about whether or not there is support for asciidoc tabs.
:asciidoc-tabs: true should be the default. :asciidoc-tabs: false can be set where tabs aren't supported, which can toggle flat behavior (which would apply to pdf also)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ebullient You make a good point.
I think the original intention behind the upstream and downstream attributes was to use them to conditionalize a set of product-only changes located throughout the docs source. That way we could have a single attribute trigger a bunch of conditionals on stuff that we only need in product docs.
For the rest of product-only changes, we could achieve a similar result to the latter by using ifeval statements and an attribute named, for example, :target: that resolves to either community or rhbq.
IMHO, we should consider changing the attribute for this specific use case according to your suggestion.
If we want to avoid mentioning terms like upstream and downstream in the community source, or if we decide that the product-only stuff cannot live in the upstream source at all, we'll need to consider another substitution mechanism, such as parameterized attributes with 2 discreet sets of attribute values, one for the community docs and the other for RHBQ.
Notably, we also want to reduce the source-level difference between upstream and downstream docs altogether. Some of the product-specific stuff, like support statements can be moved to a more visible location downstream (for example to the RN, Component details or other resources).
Even so, we'll need parameterized attributes to substitute data like builder image names and the BOM GAV, as these differ between upstream and downstream, and must be listed accurately with respect to which version of the docs they are displayed in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@inoxx03 @ebullient This is not only about changing the attribute. If I apply this approach with a single attribute with two values based on repository context, it will no longer be an ifdev condition. I would need to rewrite all the snippets to use ifeval conditions instead. @maxandersen @gsmet , will this change help you in this process, or the current state is more about not touching original files and finding the other way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think everyones life would be easier if we could just do it one way and then either transform it on HTML pages with javascript or some automatic conversion when moving it to some other publishing form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think everyones life would be easier if we could just do it one way and then either transform it on HTML pages with javascript
I could agree with that but the problem is the destructive version is the one we need. We definitely lose some structure in the downstream case and I'm not sure we will be able to easily cover all the cases (and I personally don't have the time to check all the various cases we have).
If we don't go this way, I agree with @ebullient that :asciidoc-tabs: false would be better. It should be a simple search/replace to get this PR updated. I can do it if you don't feel like doing it.
|
the current tab mechanics are simply doing blocks if there is no javascript in the HTML. Feels like we should just be able to adapt that to be picked up by some changes to javascript? |
@maxandersen The best would be to ameliorate the downstream publishing system so that these changes would not be needed at all (but this will not change). I just want to show what needs to be done so that these snippets render well in a publishing system lacking multiple-option-bar functionality. Again, I just propose a starting point for a conversation. Will be happy to test other upstream ideas that could solve this. |
|
Got an example somewhere on what bullet item style was agreed upon? Is there a reason it must be a bullet list and that the current rendering does not suffice ? Which outputs will have this form? Only pdf or? |
Let me collect all the evidence; will ping you when ready. Thank you for your interest @maxandersen So far, here is the screenshot and link to the PV2 preview build. So, since we don't have a multiple-tab feature, we display it as a list. In code, I needed to split the asciidoc headers defining the heading and code spinnet separately so that it works as originally planned, even after my edits. (visible in the PR). Each code snippet has a leading sentence. Instead of CLI (since all options are CLI in the end), we are using By using Quarkus CLI (with URL to the upstream docs). Since Quarkus CLI is not supported for production, we need to inform readers about it by adding a note that is not presented in the upstream version. So, this is not only about different markups used but also about displaying additional information based on context (upstream/downstream). |
|
Are you saying that every place we show a quarkus cli command we'll have to show readers: "The Quarks CLI is intended for development purposes only. Red Hat does not support using Quarkus CLI in production environments" ? How is that useful when the exact same applies for And why not just say that once if absolutely necessary? on the formatting - let me see if can find way to avoid needing different outputs. |
|
Hello Max! Good morning. If the same applies to the mvn and Gradle, then the best solution would be to write a short paragraph about it and put it in the Release Notes, to the Support and Compatibility section, then delete it from the snippets, sure. My intention was not to spam but not to bring anybody into trouble :) Regarding the sub-level bullet points for additional information, we have some space to maneuver here too, and it can be deleted if necessary. I will ask the team about it and will try to reach Thomas and ask him about that CLI thing. Regarding automatic transformation, every automation is welcomed. Do you plan to create a script to create other copies of these snippets for downstream use? Update:
|
|
Hi, @maxandersen To answer the questions from your previous comment:
I don't think we've made a formal agreement on this, but I have traced usage of the bullet list format back to August 2022 when we first started implementing Diataxis templates upstream and experimenting with downstreaming. Here's the earliest instance I could find of the bulleted list format being used in the security guides: 9cece61 Erin and Sergey both ACK'd the change on the PR so we understood that as acceptance.
TL;DR: The reason was to work around rendering limitations downstream (Please see Extended explanation for more details about why we use a bulleted list). Does it have to be a bulleted list, specifically? We can change it if we have a better or if the underlying limitation on the downstream side is no longer present. Extended explanation:
We are currently using the flattened form instead of tabs for HTML output downstream. (technically, the PDF output of downstream docs the would use it, too. Though we don't regularly ship PDFs of downstream docs at the moment, we can still build them on demand from source.)
No, we only show that note once per document, usually the first time a Quarkus CLI command is shown. We don't repeat the note after subsequent instances of CLI examples.
At the very basic level, it is there to protect from escalations.
Our latest decision is to do exactly that - we are putting the information into the RHBQ release notes and removing it from under the snippets in guides. On a related note, we also need a proper way to let RH customers know that Quarkus dev tools are not (and will not) be productized or supported on the same level that RHBQ Maven artifacts are.
Yes, automatic transformation would be suitable, too. We don't have the capacity in the docs team to write the transformation logic and maintain the job, so if you'd be willing to find such a solution, we'll be happy to test how it works:) In the long term, my aim is to move our downstream docs off the current tooling and onto a system that is better maintained and much less limiting. |
Signed-off-by: Michal Maléř <mmaler@redhat.com> Fixes Signed-off-by: Michal Maléř <mmaler@redhat.com> Replacing hardcoded text to ifdefs Signed-off-by: Michal Maléř <mmaler@redhat.com> Remake of the rest Signed-off-by: Michal Maléř <mmaler@redhat.com> Adding conditionaled information-bullet attribute for Q-CLI Signed-off-by: Michal Maléř <mmaler@redhat.com> Update Signed-off-by: Michal Maléř <mmaler@redhat.com>
9aaa5bb
to
399d6cd
Compare
|
@maxandersen Also, about that And why not just say that once if absolutely necessary? |
|
idea discussed on quick cal today: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thus -1 on this current PR and even if I did manage to do some adjustments to the javascript converting it on the fly it is going to be very noisy for readers.
After discussing in more detail with @inoxx03 its clear that even if I could find a way to transform this it is only done to add a disclaimer which will be extremely noisy in the docs thus its inappropriate to have.
My suggestion is you at most per doc add something like:
ifdef::dev-support-disclaimer[]
{dev-support-disclaimer}
endif::[]
which you can then use to inject a disclaimer once rather than every time the dev tools are used.
|
Closing this as the approach is not needed. @inoxx03 following up. |
Thanks to all who participated in this effort. |

The cause of this PR is to solve issues caused by Downstream obsolete tooling that doesn't support advanced features.
This solution uses ifdef and ifndef to display correct content triggered by the presence/absence of the upstream context attribute. In the downstream repo, this attribute will be called downstream.
The intention here is to keep Upstream functionality untouched and recreate the snippers so that they can be reused for downstream efforts in the shape of tabs-as-list.
Description:
I am adding one attribute, context, and if condition to recreate G. Smet's brilliant snippets for multiple-option bars so that they display in a usable way in the downstream repo, too, since this advanced asciidoc is not supported there thanks to publication tool limitations.
The attribute, context, the if-condition combo was needed because of the fact that attributes cant transcend asciidoc markup elements (out of the box). However, the solution I created here is more elegant than the pure attribute one since I added just two rows of code to our upstream-attributes-docs file.
This results in completely the same Upstream output as G. Smet proposed, but now these files render properly in Downstream as a "good-looking" bullet-item list with some additional top-notch level styling.