Skip to content

Commit d614977

Browse files
authored
Merge pull request openshift#42080 from kalexand-rh/attributes-guidelines
adding attribute file guidance
2 parents c24671c + 93591bd commit d614977

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

contributing_to_docs/doc_guidelines.adoc

+30-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Every assembly file should contain the following metadata at the top, with no li
2828
:_content-type: ASSEMBLY <1>
2929
[id="<unique-heading-for-assembly>"] <2>
3030
= Assembly title <3>
31-
include::modules/common-attributes.adoc[] <4>
31+
include::_attributes/common-attributes.adoc[] <4>
3232
:context: <unique-context-for-assembly> <5>
3333
<6>
3434
toc::[] <7>
@@ -41,7 +41,7 @@ toc::[] <7>
4141
+
4242
[NOTE]
4343
====
44-
The `{product-name}` and `{product-version}` common attributes are not defined in the `modules/common-attributes.adoc` file. Those attributes are pulled by AsciiBinder from the distro mapping definitions in the https://github.com/openshift/openshift-docs/blob/main/_distro_map.yml[_distro_map.yml] file. See xref:product-name-and-version[Product name and version] for more information on this topic.
44+
The `{product-name}` and `{product-version}` common attributes are not defined in the `_attributes/common-attributes.adoc` file. Those attributes are pulled by AsciiBinder from the distro mapping definitions in the https://github.com/openshift/openshift-docs/blob/main/_distro_map.yml[_distro_map.yml] file. See xref:product-name-and-version[Product name and version] and xref:attribute-files[attribute files] for more information on this topic.
4545
====
4646
+
4747
<5> Context used for identifying headers in modules that is the same as the anchor ID. Example: cli-developer-commands.
@@ -147,6 +147,33 @@ Place the attribute in the file metadata. The following list describes the best
147147

148148
The metadata examples contain sample placement for each file type, xref:assembly-file-metadata[assembly], xref:module-file-metadata[module], and xref:snippet-file-metadata[snippet].
149149

150+
[id="attribute-files"]
151+
== Attribute files
152+
153+
All attribute files must be placed in the `_attributes` directory. In most cases involving OpenShift Container Platform or OKD, add attributes to the `common-attributes.adoc` file instead of creating or using a separate attributes file. Before you add an attribute, review the contents of the `common-attributes.adoc` file to ensure that it is not already defined.
154+
155+
[IMPORTANT]
156+
====
157+
If you think that you need a separate attributes file, check with the docs team before you create it.
158+
====
159+
160+
It is acceptable to group related attributes in the `common-attributes.adoc` file under a comment, as shown in the following example:
161+
162+
----
163+
//gitops
164+
:gitops-title: Red Hat OpenShift GitOps
165+
:gitops-shortname: GitOps
166+
----
167+
168+
It is also acceptable to enclose attributes in a xref:product-name-and-version[distro-based] conditional. The following example shows how to set a different value for the `:op-system-base:` attribute for OKD:
169+
170+
----
171+
:op-system-base: RHEL
172+
ifdef::openshift-origin[]
173+
:op-system-base: Fedora
174+
endif::[]
175+
----
176+
150177
== Assembly/module file names
151178

152179
Try to shorten the file name as much as possible _without_ abbreviating important terms that may cause confusion. For example, the `managing-authorization-policies.adoc` file name would be appropriate for an assembly titled "Managing Authorization Policies".
@@ -455,7 +482,7 @@ If it makes more sense in context to refer to the major version of the product i
455482

456483
[NOTE]
457484
====
458-
Other common attribute values are defined in the `modules/common-attributes.adoc` file. Where possible, generalize references to those values by using the common attributes. For example, use `{console-redhat-com}` to refer to Red Hat OpenShift Cluster Manager.
485+
Other common attribute values are defined in the `_attributes/common-attributes.adoc` file. Where possible, generalize references to those values by using the common attributes. For example, use `{console-redhat-com}` to refer to Red Hat OpenShift Cluster Manager. If you need to add an attribute to the `_attributes/common-attributes.adoc` file, open a pull request to add it to the attribute list. Do not create a separate attributes file without first consulting the docs team.
459486
====
460487

461488
[id="conditional-content"]

0 commit comments

Comments
 (0)