grails-core icon indicating copy to clipboard operation
grails-core copied to clipboard

Documentation: Cleanup Title Sequence

Open jamesfredley opened this issue 5 months ago • 3 comments

Issue description

Run ./gradlew assemble

Review and correct error like the following:

WARNING: eventsAutoTimestamping.adoc: line 36: section title out of sequence: expected level 1, got level 3
WARNING: eventsAutoTimestamping.adoc: line 174: section title out of sequence: expected level 1, got level 3
WARNING: eventsAutoTimestamping.adoc: line 91: section title out of sequence: expected level 1, got level 3
WARNING: eventsAutoTimestamping.adoc: line 114: section title out of sequence: expected level 1, got level 3
WARNING: configurationDefaults.adoc: line 22: section title out of sequence: expected level 1, got level 3

jamesfredley avatar Jul 12 '25 00:07 jamesfredley

The issue is that the documentation is assembled from multiple documents.

The root document index.adoc includes multiple other documents fx. advancedGORMFeatures/eventsAutoTimestamping.adoc When the included documents are processed individually Asciidoctor complains about the headlines starting from level 3 (which is where the root document expects them).

Solution 1 I think a solution is to write the documents as if they where not to be inserted in the root document (treat them as individual docs), meaning headlines starts from level 1. When inserted into the root document (index.adoc) we then adjust the level offset: include::advancedGORMFeatures/eventsAutoTimestamping.adoc[leveloffset=+2]

https://docs.asciidoctor.org/asciidoc/latest/directives/include-with-leveloffset/

The drawback is that it requires some editing, there are a lot of *.adoc files...

Solution 2 Or if we don't want to generate the files in the sub folders, prefix those documents and folders with an underscore _ which will exclude them unless they are included from other files.

dauer avatar Aug 15 '25 09:08 dauer

Solution 1 is the selected direction

jamesfredley avatar Aug 20 '25 23:08 jamesfredley

Here is a current example of a slightly different take on Solution 1.

https://github.com/apache/grails-core/blob/0c944d3556b3fdffb4f81a15fdd390b4e58ee6a4/grails-doc/src/en/guide/index.adoc?plain=1#L268-L277

https://github.com/apache/grails-core/blob/1d49052586a2246acf9772cff45009332022c0b2/grails-doc/src/en/guide/profiles/creatingProfiles.adoc?plain=1#L19-L53

jamesfredley avatar Aug 26 '25 19:08 jamesfredley