Skip to content

Commit a9600ad

Browse files
authored
DOC-612 add single sourcing guidance (#111)
* DOC-612 add single sourcing guidance * fix typos * add single-sourced content, like properties * fix escape * remove Cloud pages, edit beta features sections * add that you can reference partials across repos
1 parent 5c0de46 commit a9600ad

File tree

1 file changed

+96
-13
lines changed

1 file changed

+96
-13
lines changed

meta-docs/CONTRIBUTING.adoc

Lines changed: 96 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ The Redpanda docs team uses GitHub issues to track, plan, and prioritize tasks.
7272

7373
You have the option to assign the issue to yourself or leave the assignee field blank. The Redpanda docs team triages all new issues and will allocate a writer if one isn't already assigned.
7474

75-
IMPORTANT: If you are a Redpanda employee, submit doc issues in the https://github.com/redpanda-data/documentation-private[`redpanda-data/documentation-private`] repo.
75+
IMPORTANT: If you are a Redpanda employee, submit doc issues in https://redpandadata.atlassian.net/jira/software/c/projects/DOC/boards/65[Jira].
7676

7777
=== Contribute content
7878

@@ -317,7 +317,7 @@ For example:
317317
** xref:get-started:code-examples.adoc[Build a Sample Application]
318318
....
319319

320-
<1> This page is an index. After the build, it will contains the titles and descriptions of all the topics underneath it.
320+
<1> This page is an index. After the build, it will contain the titles and descriptions of all the topics underneath it.
321321

322322
To create an index page, give it a title and the `page-layout: index` attribute.
323323

@@ -356,7 +356,7 @@ Antora calculates the URL for a source page's resource ID and generates redirect
356356

357357
NOTE: A resource ID assigned to a page-aliases attribute can be used in an xref. Therefore, if you delete, rename, or move a page, you don't need to update any references to it in your source files.
358358

359-
The content of the page-aliases attribute are used to create Netlify redirects in the `_redirects` file at build time.
359+
The content of the page-aliases attribute is used to create Netlify redirects in the `_redirects` file at build time.
360360

361361
IMPORTANT: Make sure that links are relative to the current component version. Do not link to specific versions in page aliases.
362362

@@ -374,11 +374,13 @@ asciidoc:
374374

375375
== Single-sourcing
376376

377-
Practice the DRY (Don't Repeat Yourself) principle by single-sourcing repeated content. Common examples of single-sourced content include prerequisites, contact info, and foundational steps of how-to guides.
377+
Practice the DRY (don't repeat yourself) principle by single-sourcing repeated content. Common examples of single-sourced content include prerequisites, contact info, and foundational steps of how-to guides.
378378

379-
Antora supports single-sourcing Asciidoc files that are located in the `partials/` directory. For details about partials, see {url-antora-docs}/antora/latest/page/partials/[Partials] in the Antora docs.
379+
For single-sourcing content in _different_ repositories, see <<single-sourcing-pages-across-repos, Single-sourcing across repos>>.
380380

381-
NOTE: You can include partials inside other partials.
381+
For single-sourcing content in the _same_ repository, put shared content in the `partials/` directory. For details about partials, see {url-antora-docs}/antora/latest/page/partials/[Partials] in the Antora docs.
382+
383+
NOTE: You can include partials inside other partials. You can also reference partials when single-sourcing across repos.
382384

383385
Inside partials, you can conditionally render content depending on attributes that are available on the page that you include them in.
384386

@@ -391,7 +393,7 @@ This will be rendered only if the pages you include the partial in do not have t
391393
\endif::[]
392394
393395
\ifdef::env-kubernetes[]
394-
This will be rendered only if the pages you include the partial in has the `env-kubernetes` attribute.
396+
This will be rendered only if the pages you include the partial in have the `env-kubernetes` attribute.
395397
\endif::[]
396398
----
397399

@@ -409,6 +411,91 @@ If you need to link to different pages in partials depending on the context of t
409411
To learn more, see xref:{data-archiving-link}[Data Archiving]
410412
----
411413

414+
=== Single-sourcing pages across repos
415+
416+
Redpanda documentation sits in different repositories for Self-Managed, Cloud, Redpanda Connect, and Labs. (See <<find-content, Find content>>.)
417+
418+
To single-source pages across repos:
419+
420+
. In the source repository, wrap the single-sourced page, after the title and aliases, with `// tag::single-source[]`.
421+
. In the other repository, add the content with an `include` directive and the `single-source` tag. For example:
422+
+
423+
`include::ROOT:get-started:partner-integration.adoc[tag=single-source]`
424+
+
425+
For more information about the include directive, see the https://docs.asciidoctor.org/asciidoc/latest/directives/include/[Asciidoc docs].
426+
427+
For an example of a page single-sourced from the `docs` repo into the `cloud-docs` repo, see https://docs.redpanda.com/current/get-started/partner-integration/ and https://docs.redpanda.com/redpanda-cloud/get-started/partner-integration/.
428+
429+
The file source in the `docs` repo looks like this:
430+
[,asciidoc]
431+
----
432+
= Partner Integrations
433+
:page-aliases: reference:partner-integration.adoc
434+
// tag::single-source[]
435+
:description: Learn about Redpanda integrations built and supported by our partners.
436+
437+
Learn about Redpanda integrations built and supported by our partners.
438+
439+
[.no-clip]
440+
[cols="1a,2a,1a"]
441+
|===
442+
|*Partner* |*Description* |*More information*
443+
...
444+
445+
// end::single-source[]
446+
----
447+
448+
The shared version of this page in the `cloud-docs` repo looks like this:
449+
[,asciidoc]
450+
----
451+
= Partner Integrations
452+
\include::ROOT:get-started:partner-integration.adoc[tag=single-source]
453+
----
454+
455+
Single-sourcing pages across repos usually requires two PRs (one for each repo) as well as conditionals. For example:
456+
[,asciidoc]
457+
----
458+
* xref:get-started:rpk-install.adoc[]
459+
* xref:get-started:config-rpk-profile.adoc[]
460+
// This topic is not available in our Cloud docs.
461+
\ifndef::env-cloud[]
462+
* xref:get-started:rpk-quickstart.adoc[]
463+
\endif::[]
464+
----
465+
466+
=== Single-sourcing content across repos
467+
468+
To single source certain content:
469+
470+
. In the source repository, wrap the single-sourced content with a `tag`.
471+
. In the other repository, add the tag in an `include` directive.
472+
473+
For example, in the `cluster-properties.adoc` source file in the `docs` repo, add:
474+
475+
[,asciidoc]
476+
----
477+
// tag::audit_excluded_principals[]
478+
=== audit_excluded_principals
479+
480+
List of user principals to exclude from auditing.
481+
482+
*Requires restart:* No
483+
484+
*Visibility:* `user`
485+
486+
*Type:* array
487+
488+
*Default:* `null`
489+
490+
---
491+
492+
// end::audit_excluded_principals[]
493+
----
494+
495+
In the `cloud-docs` file where you want to add this shared content, add an include directive:
496+
497+
`include::ROOT:reference:properties/cluster-properties.adoc[tags=audit_excluded_principals]`
498+
412499
== Update the nav tree
413500

414501
All doc repositories use a single navigation file for the nav tree, which is defined in the `nav.adoc` file of the `ROOT` module.
@@ -417,13 +504,9 @@ To update the nav tree, edit the `nav.adoc` file.
417504

418505
For more information about navigation files, see the {url-antora-docs}/antora/latest/navigation/include-lists/[Antora docs].
419506

420-
== Cloud pages
421-
422-
Redpanda Cloud pages should be tagged accordingly. If you create a Redpanda Cloud page make sure to add the attribute `page-cloud:true` to the top of the file under the title.
423-
424-
=== Cloud beta feature
507+
=== beta features
425508

426-
Cloud has a different flavor of beta, where some specific features can be marked as beta. If that's the case, add the attribute `page-beta:true` to your page, after `page-cloud:true`.
509+
In `cloud-docs`, and occasionally in other repos, individual features can exist in beta status. If that's the case, add the attribute `page-beta:true` to your page header.
427510

428511
== Feature flag
429512

0 commit comments

Comments
 (0)