Skip to content

Commit 496251a

Browse files
authored
Merge pull request #33619 from ebullient/docs-errors
Show metadata errors in the docs build
2 parents d585c1f + 45cedf8 commit 496251a

33 files changed

+166
-99
lines changed

.github/workflows/doc-build.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,15 @@ jobs:
5555
5656
- name: Build Docs
5757
run: |
58-
./mvnw -e -B --settings .github/mvn-settings.xml clean package -pl docs -Dasciidoctor.fail-if=DEBUG
58+
if ./mvnw -e -B --settings .github/mvn-settings.xml clean package -pl docs -Dasciidoctor.fail-if=DEBUG ; then
59+
echo "Build ok"
60+
else
61+
if [ -f docs/target/metadataErrors.md ]; then
62+
echo "### Document Metadata Errors" >> $GITHUB_STEP_SUMMARY
63+
cat docs/target/metadataErrors.md >> $GITHUB_STEP_SUMMARY
64+
fi
65+
exit 1
66+
fi
5967
6068
- name: Store PR id
6169
run: echo ${{ github.event.number }} > pr-id.txt

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.

0 commit comments

Comments
 (0)