Skip to content

Commit 45cedf8

Browse files
ebullientgsmet
authored andcommitted
Determine document type from attributes
1 parent b37cf91 commit 45cedf8

29 files changed

+112
-76
lines changed

docs/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3003,7 +3003,7 @@
30033003
</execution>
30043004
<execution>
30053005
<id>generate-doc-manifests</id>
3006-
<phase>prepare-package</phase>
3006+
<phase>package</phase>
30073007
<goals>
30083008
<goal>java</goal>
30093009
</goals>

docs/src/main/asciidoc/_examples/acme-serve-http-requests-tutorial.adoctxt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
66
[id="acme-serve-http-requests-tutorial"]
77
= Serve Http requests using the Acme extension
88
include::_attributes.adoc[]
9+
:diataxis-type: tutorial
910
:categories: web
1011
:extension-status: experimental
1112

12-
In this tutorial, we will create an application that uses unique annotations from the experimental acme extension to define two endpoints:
13-
a simple Http endpoint and an endpoint that emits Server-Sent Events (SSE).
14-
We will also use Quarkus dev mode for iterative development and test.
13+
Create an application that uses unique annotations from the experimental acme extension to define two endpoints:
14+
a simple HTTP endpoint and an endpoint that emits server-sent events (SSE).
15+
We will also use Quarkus dev mode for iterative development and testing.
1516

1617
include::{includes}/extension-status.adoc[]
1718

docs/src/main/asciidoc/_templates/template-concept.adoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ and pull requests should be submitted there:
44
https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
55
////
66
////
7-
TODO: xref:{doc-guides}/doc-reference.adoc[Quarkus style and content guidelines] for details
8-
- Title should have an implied "Understanding..." in front.
9-
- ID should end with '-concept' (using the filename works)
10-
- choose appropriate categories
7+
TODO:
8+
- Title: https://quarkus.io/guides/doc-reference#titles-headings
9+
- Use the file name as the ID
10+
- Choose appropriate categories: https://quarkus.io/guides/doc-reference#categories
1111
////
12-
[id="...-concept"]
12+
[id="..."]
1313
= Title using sentence capitalization
1414
include::_attributes.adoc[]
15+
:diataxis-type: concept
1516
:categories: ...
1617
////
1718
:extension-status: preview

docs/src/main/asciidoc/_templates/template-howto.adoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ and pull requests should be submitted there:
44
https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
55
////
66
////
7-
TODO: See xref:{doc-guides}/doc-reference.adoc[Quarkus style and content guidelines] for details
8-
- Title should have an implied "How to..." in front.
9-
- ID should end with '-howto' (using the filename works)
10-
- choose appropriate categories
7+
TODO:
8+
- Title: https://quarkus.io/guides/doc-reference#titles-headings
9+
- Use the file name as the ID
10+
- Choose appropriate categories: https://quarkus.io/guides/doc-reference#categories
1111
////
12-
[id="...-howto"]
12+
[id="..."]
1313
= Title using sentence capitalization
1414
include::_attributes.adoc[]
15+
:diataxis-type: howto
1516
:categories: ...
1617
////
1718
:extension-status: preview

docs/src/main/asciidoc/_templates/template-reference.adoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ and pull requests should be submitted there:
44
https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
55
////
66
////
7-
TODO: See xref:{doc-guides}/doc-reference.adoc[Quarkus style and content guidelines] for details
8-
- Title should have an implied "About..." in front.
9-
- ID should end with '-reference' (using the filename works)
10-
- choose appropriate categories
7+
TODO:
8+
- Title: https://quarkus.io/guides/doc-reference#titles-headings
9+
- Use the file name as the ID
10+
- Choose appropriate categories: https://quarkus.io/guides/doc-reference#categories
1111
////
12-
[id="...-reference"]
12+
[id="..."]
1313
= Title using sentence capitalization
1414
include::_attributes.adoc[]
15+
:diataxis-type: reference
1516
:categories: ...
1617
////
1718
:extension-status: preview

docs/src/main/asciidoc/_templates/template-tutorial.adoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ and pull requests should be submitted there:
44
https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
55
////
66
////
7-
TODO: See xref:{doc-guides}/doc-reference.adoc[Quarkus style and content guidelines]for details
8-
- Finish a sentence like: "Create a ...", "How to ..."
9-
- ID should end with '-tutorial' (using the filename works)
10-
- choose appropriate categories
7+
TODO:
8+
- Title: https://quarkus.io/guides/doc-reference#titles-headings
9+
- Use the file name as the ID
10+
- Choose appropriate categories: https://quarkus.io/guides/doc-reference#categories
1111
////
12-
[id="...-tutorial"]
12+
[id="..."]
1313
= Title using sentence capitalization
1414
include::_attributes.adoc[]
15+
:diataxis-type: tutorial
1516
:categories: ...
1617
////
1718
:extension-status: preview

docs/src/main/asciidoc/doc-concept.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
66
[id="doc-concept"]
77
= Quarkus documentation content types
88
include::_attributes.adoc[]
9+
:diataxis-type: concept
910
:categories: contributing
1011
:fn-diataxis: footnote:diataxis[Procida, D. Diátaxis documentation framework. https://diataxis.fr/]
1112

docs/src/main/asciidoc/doc-contribute-docs-howto.adoc

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
55
[id="doc-contribute-howto"]
66
= Contribute to Quarkus documentation
77
include::_attributes.adoc[]
8+
:diataxis-type: howto
89
:categories: contributing
910
:fn-diataxis: footnote:diataxis[Procida, D. Diátaxis documentation framework. https://diataxis.fr/]
1011

@@ -39,28 +40,32 @@ To ensure that your content shows up correctly on the link:https://quarkus.io/gu
3940
TIP: To help you decide, see the content type descriptions in xref:{doc-guides}/doc-reference.adoc#titles-and-headings[Titles and headings] on the "About Quarkus documentation" page.
4041

4142
. Go to the `src/main/asciidoc/_templates` directory, and make a copy of the relevant template for the content type you have chosen. Be sure to:
42-
** Use the filename syntax of`<category>-<titlekeyword>-<titlekeyword>-<content-type>.adoc`. For example, `security-basic-authentication-tutorial.adoc`.
43+
** Use the filename syntax of`<category>-<titlekeyword>-<titlekeyword>.adoc`. For example, `security-basic-authentication.adoc`.
44+
** Include the diataxis type (concept, howto, reference, tutorial) in the file name if it makes sense to do so.
45+
For example, `telemetry-micrometer.adoc` is a reference, and `telemetry-micrometer-tutorial.adoc` is a tutorial.
4346
** Save the file to the `docs/src/main/asciidoc` folder in the `quarkus` repository.
4447

4548
. Set the minimum required header information to ensure that the content renders correctly in the website portal and on the documentation home page, as outlined in the following example:
4649
+
4750
[source,asciidoc]
4851
----
49-
[id="security-basic-authentication-howto"] <1>
52+
[id="security-basic-authentication"] <1>
5053
= Secure a Quarkus application with basic authentication <2>
5154
include::_attributes.adoc[] <3>
52-
:categories: security,web <4>
53-
<5>
55+
:diataxis-type: howto <4>
56+
:categories: security,web <5>
57+
<6>
5458
----
55-
<1> Set the `id` value to be the same as the file name but without the extension. You can shorten this if the file name is too long.
59+
<1> Set the `id` value to be the same as the file name but without the extension.
5660
<2> For information about how to create a good title for each content type, see xref:{doc-guides}/doc-reference.adoc#titles-and-headings[Titles and headings] on the "Quarkus style and content guidelines" page.
5761
<3> The `_attributes.adoc` include is required to ensure that attributes get resolved and the table of contents is generated.
58-
<4> Set at least one category to ensure that the content is findable on the link:https://quarkus.io/guides/[Quarkus documentation home page]. For a list of Quarkus categories, see xref:{doc-guides}/doc-reference.adoc#document-attributes-and-variables[Document attributes and variables] on the "Quarkus style and content guidelines" page.
59-
<5> Insert a blank line before the abstract.
62+
<4> Specify the diataxis type: `concept`, `howto`, `reference`, or `tutorial`.
63+
<5> Set at least one category to ensure that the content is findable on the link:https://quarkus.io/guides/[Quarkus documentation home page]. For a list of Quarkus categories, see xref:{doc-guides}/doc-reference.adoc#document-attributes-and-variables[Document attributes and variables] on the "Quarkus style and content guidelines" page.
64+
<6> Insert a blank line after all document attributes and before the abstract.
6065
+
6166
[IMPORTANT]
6267
====
63-
Ensure there are no line breaks in the header section until after `:categories:` line.
68+
Ensure there are no blank lines between the document id and title, the attribute include (`include::_attributes.adoc[]`) and the declaration of other document attributes(`:attribute:`).
6469
====
6570

6671
. Add an abstract that describes the purpose of the guide.

docs/src/main/asciidoc/doc-create-tutorial.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
66
[id="doc-create-tutorial"]
77
= Creating a tutorial
88
include::_attributes.adoc[]
9+
:diataxis-type: tutorial
910
:categories: contributing
1011

1112
Create a new tutorial that guides users through creating, running, and testing a Quarkus application that uses annotations from an imaginary extension.
@@ -29,7 +30,8 @@ For this example, we will use `acme-serve-http-requests-tutorial.adoc`:
2930

3031
- `acme-` will group this guide with other resources related to the acme extension
3132
- `serve-http-requests` is a derivative of the document title
32-
- `-tutorial.adoc` will indicate that this document is a tutorial
33+
- `-tutorial` will indicate that this document is a tutorial (optional)
34+
- `.adoc` to indicate this is an asciidoc file
3335

3436
== Copy the tutorial template
3537

@@ -46,7 +48,7 @@ include::_attributes.adoc[] // <3>
4648
:extension-status: experimental // <5>
4749
----
4850

49-
<1> Specify a unique id for the section in lower-kebab-case.
51+
<1> Use the file name as a unique id for the section.
5052
<2> Add the title as a top-level heading.
5153
<3> Include additional attributes that help define consistent formatting and provide source portability.
5254
<4> Specify the `web` category, as our imaginary extension works with Http requests.

docs/src/main/asciidoc/doc-reference.adoc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
66
[id="doc-reference"]
77
= Quarkus style and content guidelines
88
include::_attributes.adoc[]
9+
:diataxis-type: reference
910
:categories: contributing
1011

1112
Guidelines are provided to help you to contribute clear and consistent content that is also sourced in the required diataxis structure and composition of Quarkus documentation.
@@ -132,13 +133,12 @@ Use all lowercase letters, separate words with hyphens, and avoid symbols and sp
132133
Prefix:: Use a common prefix to group-related documents.
133134
Documents related to writing and contributing to Quarkus docs share the `doc-` prefix, for example.
134135

135-
Suffix:: The file name should reflect the document type:
136-
137-
- Concept documents should end in `-concept.adoc`
138-
- How-to guides should end in `-howto.adoc`
139-
- References should end in `-reference.adoc`
140-
- Tutorials should end in `-tutorial.adoc`
136+
Suffix:: Use a suffix that reflects the document type (optional):
141137

138+
- `-concept.adoc` for concept documents
139+
- `-howto.adoc` for how-to guides
140+
- `-reference.adoc` for references
141+
- `-tutorial.adoc` for tutorials
142142

143143
[[doc-structure]]
144144
== Document structure
@@ -156,13 +156,15 @@ Minimally, each document should define and id and a title, and include common at
156156
[id="doc-reference"] // <1>
157157
= Quarkus style and content guidelines // <2>
158158
\include::_attributes.adoc[] // <3>
159-
:categories: contributing // <4>
159+
:diataxis-type: {type} // <4>
160+
:categories: contributing // <5>
160161
----
161162

162163
<1> Use the filename as the ID for the document.
163164
<2> Define the document title following guidance in <<titles-headings>>.
164165
<3> Include common document attributes.
165-
<4> Specify the relevant <<categories>> (comma separated).
166+
<4> Specify the diataxis type: `concept`, `howto`, `reference`, or `tutorial`.
167+
<5> Specify the relevant <<categories>> (comma separated).
166168

167169
[[doc-header-optional]]
168170
==== Other common document header attributes

0 commit comments

Comments
 (0)