Skip to content

Commit 58d4b99

Browse files
committed
adding file type attribute guidance
1 parent a45802d commit 58d4b99

File tree

1 file changed

+50
-17
lines changed

1 file changed

+50
-17
lines changed

contributing_to_docs/doc_guidelines.adoc

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,33 @@ It is not necessary to update existing content to unwrap lines, but you can remo
2020
In the Atom editor, you can use `Ctrl`+`J` to undo hard wrapping on a paragraph.
2121
====
2222

23+
[id="assembly-file-metadata"]
2324
== Assembly file metadata
2425
Every assembly file should contain the following metadata at the top, with no line spacing in between, except where noted:
2526

2627
----
27-
[id="<unique-heading-for-assembly>"] <1>
28-
= Assembly title <2>
29-
include::modules/common-attributes.adoc[] <3>
30-
:context: <unique-context-for-assembly> <4>
31-
<5>
32-
toc::[] <6>
28+
:_content-type: ASSEMBLY <1>
29+
[id="<unique-heading-for-assembly>"] <2>
30+
= Assembly title <3>
31+
include::modules/common-attributes.adoc[] <4>
32+
:context: <unique-context-for-assembly> <5>
33+
<6>
34+
toc::[] <7>
3335
----
3436

35-
<1> A unique (within OpenShift docs) anchor id for this assembly. Use lowercase. Example: cli-developer-commands
36-
<2> Human readable title (notice the '=' top-level header)
37-
<3> Includes attributes common to OpenShift docs.
37+
<1> The content type for the file. For assemblies, always use `:_content-type: ASSEMBLY`. Place this attribute before the anchor ID or, if present, the conditional that contains the anchor ID.
38+
<2> A unique (within OpenShift docs) anchor ID for this assembly. Use lowercase. Example: cli-developer-commands
39+
<3> Human readable title (notice the '=' top-level header)
40+
<4> Includes attributes common to OpenShift docs.
3841
+
3942
[NOTE]
4043
====
4144
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.
4245
====
4346
+
44-
<4> Context used for identifying headers in modules that is the same as the anchor id. Example: cli-developer-commands.
45-
<5> A blank line. You *must* have a blank line here before the toc.
46-
<6> The table of contents for the current assembly.
47+
<5> Context used for identifying headers in modules that is the same as the anchor ID. Example: cli-developer-commands.
48+
<6> A blank line. You *must* have a blank line here before the toc.
49+
<7> The table of contents for the current assembly.
4750

4851
After the heading block and a single whitespace line, you can include any content for this assembly.
4952

@@ -54,6 +57,7 @@ Section headers within the assembly must be level 2 ( == ) or lower. When you in
5457
leveloffsets in the include statements. You can manually add more level 2 or lower section headers in the assembly.
5558
====
5659

60+
[id="module-file-metadata"]
5761
== Module file metadata
5862
Every module should be placed in the modules folder and should contain the following metadata at the top:
5963

@@ -62,13 +66,15 @@ Every module should be placed in the modules folder and should contain the follo
6266
//
6367
// * list of assemblies where this module is included <1>
6468
65-
[id="<module-anchor>_{context}"] <2>
66-
= Module title <3>
69+
:_content-type: <TYPE> <2>
70+
[id="<module-anchor>_{context}"] <3>
71+
= Module title <4>
6772
----
6873

69-
<1> List of assemblies in which this module is included.
70-
<2> A module anchor with {context} that must be lowercase and must match the module's file name.
71-
<3> Human readable title. To ensure consistency in the results of the
74+
<1> The content type for the file. Replace `<TYPE>` with the actual type of the module, `CONCEPT`, `REFERENCE`, or `PROCEDURE`. Place this attribute before the anchor ID or, if present, the conditional that contains the anchor ID.
75+
<2> List of assemblies in which this module is included.
76+
<3> A module anchor with {context} that must be lowercase and must match the module's file name.
77+
<4> Human readable title. To ensure consistency in the results of the
7278
leveloffset values in include statements, you must use a level one heading
7379
( = ) for the module title.
7480

@@ -79,10 +85,12 @@ Example:
7985
//
8086
// * cli_reference/openshift_cli/developer-cli-commands.adoc
8187
88+
:_content-type: REFERENCE
8289
[id="cli-basic-commands_{context}"]
8390
= Basic CLI commands
8491
----
8592

93+
[id="snippet-file-metadata"]
8694
== Text snippet file metadata
8795
Every text snippet should be placed in the snippets folder and should contain the following metadata at the top:
8896

@@ -94,9 +102,12 @@ Every text snippet should be placed in the snippets folder and should contain th
94102
// Text snippet included in the following modules: <2>
95103
//
96104
// * list of modules where this text snippet is included
105+
106+
:_content-type: SNIPPET <3>
97107
----
98108
<1> List of assemblies in which this text snippet is included.
99109
<2> List of modules in which this text snippet is included.
110+
<1> The content type for the file. For snippets, always use `:_content-type: SNIPPET`. Place this attribute before the anchor ID, the conditional that contains the anchor ID, or the first line of body text.
100111

101112
[NOTE]
102113
====
@@ -112,9 +123,30 @@ Example:
112123
// * installing/installing_azure/installing-azure-default.adoc
113124
// * installing/installing_gcp/installing-gcp-default.adoc
114125
126+
:_content-type: SNIPPET
115127
In {product-title} version {product-version}, you can install a cluster on {cloud-provider-first} ({cloud-provider}) that uses the default configuration options.
116128
----
117129

130+
== Content type attributes
131+
132+
Each `.adoc` file must contain a `:_content-type:` attribute in its metadata that indicates its file type. This information is used by some publication processes to sort and label files.
133+
134+
Add the attribute from the following list that corresponds to your file type:
135+
136+
* `:_content-type: ASSEMBLY`
137+
* `:_content-type: CONCEPT`
138+
* `:_content-type: PROCEDURE`
139+
* `:_content-type: REFERENCE`
140+
* `:_content-type: SNIPPET`
141+
142+
Place the attribute in the file metadata. The following list describes the best attribute placement options:
143+
144+
. Directly before the first anchor ID in a file
145+
. If the first anchor ID is enclosed in a conditional, before the conditional
146+
. Between the list of assemblies in which this module is included and the first line of body text
147+
148+
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].
149+
118150
== Assembly/module file names
119151

120152
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".
@@ -147,6 +179,7 @@ For example, if you are creating the links in a directory that is two levels dee
147179
----
148180
$ ln -s ../../images/ images
149181
$ ln -s ../../modules/ modules
182+
$ ln -s ../../snippets/ snippets
150183
----
151184
+
152185
Be sure to adjust the number of levels to back up (`../`) depending on how deep your directory is.

0 commit comments

Comments
 (0)