redhat-documentation / modular-docs

Modular Documentation Project provides guidelines and examples for writing technical documentation using a modular framework.
Creative Commons Attribution Share Alike 4.0 International
80 stars 67 forks source link

Clarify the use of a default value for the context variable in modules #167

Closed vikram-redhat closed 2 years ago

vikram-redhat commented 3 years ago

As per the mod docs requirements, modules require a context be available to create proper anchor ids (although the context can be used for other decisions within modules as well). This value of the context is defined within the containing assembly and is then available to the module.

However, PV2 allows us to publish standalone modules. In those cases, the value of the context in standalone modules is undefined. This creates a problem, from an engineering point of view, but also a process point of view.

Having discussed this with the PV2 team, a suggestion is that the authors add a ifndef clause in all modules to define a default context, provided one hasn't already been defined by a containing assembly (https://projects.engineering.redhat.com/browse/CCS-4421).

I wanted to put this out here for further discussion:

I realize that these mod docs guidelines are independent from the target implementation (in this case, PV2) and that there will probably need to be a software solution to this as well.

VladimirSlavik commented 3 years ago

Just so the technical alternative is on the table: Attributes can be defined when invoking asciidoctor: asciidoctor --attribute context=standalone (...) some-module-file.adoc (...) and that's it. No need to add anything to templates, you get the "default" context value of standalone before the file is interpreted. In (b)ccutil, the authors of the tool can do the same: Add a context value before they convert the document using asciidoctor api. The principle is the same. A quick glance at the api docs suggests this should be possible.

That could free writers from yet more programming inside the documents. However, it also moves control of the default context to ccutil or Pantheon. That is a different consideration.

vikram-redhat commented 3 years ago

@VladimirSlavik - correct. Somehow, we need to provide a default value for the context variable, otherwise independently published modules won't have a value for it, and that could lead to unknown problems down the line.

sterobin commented 2 years ago

We discussed this issue in the FCC board and I had a phone call with @vikram-redhat to walk through some considerations around this.

TLDR version:

We've confirmed that this doesn't actually seem to be a problem with Pv2 today, and even if it were, we agreed that it still is best to not define explicit module-level context value. Instead, in edge cases where module-level context values are needed, it should be the implementation's job to account for that, whether through build methods like @VladimirSlavik mentions, through tooling ID definitions like in Pv2 at Red Hat or another tool among community FCC users, etc. Therefore closing this issue here.

Detailed review of discussion points and decisions: