Skip to content

Commit 27b7649

Browse files
committed
Revert "Adapt the most recent docgen changes"
This reverts commit cdae032.
1 parent cdae032 commit 27b7649

File tree

4 files changed

+31
-66
lines changed

4 files changed

+31
-66
lines changed

pom.xml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
<maven.site.deploy.skip>true</maven.site.deploy.skip>
335335

336336
<!-- Dependency versions -->
337-
<log4j-docgen.version>1.0.0-SNAPSHOT</log4j-docgen.version>
337+
<log4j-docgen.version>0.8.0-SNAPSHOT</log4j-docgen.version>
338338

339339
<!-- Versions of libraries whose plugin descriptors will be documented: -->
340340
<docgen.log4j.version>2.23.0-SNAPSHOT</docgen.log4j.version>
@@ -873,32 +873,20 @@
873873
<artifactId>log4j-docgen-maven-plugin</artifactId>
874874
<version>${log4j-docgen.version}</version>
875875
<inherited>false</inherited>
876-
877-
<!-- Common docgen configuration -->
878-
<configuration>
879-
<descriptorFileMatchers>
880-
<descriptorFileMatcher>
881-
<baseDirectory>${project.build.directory}/plugin-descriptors</baseDirectory>
882-
<pathPatterns>glob:**/*.xml</pathPatterns>
883-
</descriptorFileMatcher>
884-
</descriptorFileMatchers>
885-
<typeFilter>
886-
<excludes>
887-
<exclude>java\..+</exclude>
888-
</excludes>
889-
</typeFilter>
890-
</configuration>
891-
892876
<executions>
893-
894-
<!-- Generate AsciiDoc from download plugin descriptors -->
895877
<execution>
896878
<id>generate-plugin-docs</id>
897879
<goals>
898880
<goal>generate-documentation</goal>
899881
</goals>
900882
<phase>pre-site</phase>
901883
<configuration>
884+
<descriptorFileMatchers>
885+
<descriptorFileMatcher>
886+
<baseDirectory>${project.build.directory}/plugin-descriptors</baseDirectory>
887+
<pathPatterns>glob:**/*.xml</pathPatterns>
888+
</descriptorFileMatcher>
889+
</descriptorFileMatchers>
902890
<templateDirectory>${project.basedir}/src/docgen-templates</templateDirectory>
903891
<scalarsTemplate>
904892
<source>scalars.adoc.ftl</source>
@@ -914,21 +902,23 @@
914902
</pluginTemplate>
915903
</configuration>
916904
</execution>
917-
918-
<!-- Generate XSD from download plugin descriptors -->
919905
<execution>
920906
<id>generate-plugin-schema</id>
921907
<goals>
922908
<goal>generate-schema</goal>
923909
</goals>
924910
<phase>pre-site</phase>
925911
<configuration>
912+
<descriptorFileMatchers>
913+
<descriptorFileMatcher>
914+
<baseDirectory>${project.build.directory}/plugin-descriptors</baseDirectory>
915+
<pathPatterns>glob:**/*.xml</pathPatterns>
916+
</descriptorFileMatcher>
917+
</descriptorFileMatchers>
926918
<schemaFile>${project.build.directory}/generated-sources/site/resources/config.xsd</schemaFile>
927919
</configuration>
928920
</execution>
929-
930921
</executions>
931-
932922
</plugin>
933923

934924
<plugin>

src/docgen-templates/interface.adoc.ftl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,5 @@ ${type.description.text}
3535
== Known implementations
3636

3737
<#list type.implementations as impl>
38-
<#assign implSourcedType = lookup[impl]/>
39-
* xref:../../${implSourcedType.groupId}/${implSourcedType.artifactId}/${impl}.adoc[${impl?contains('.')?then(impl?keep_after_last('.'), impl)}]
38+
* xref:${impl}.adoc[${impl?contains('.')?then(impl?keep_after_last('.'), impl)}]
4039
</#list>

src/docgen-templates/plugin.adoc.ftl

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Class:: `${type.className}`
2727
<#if sourcedType.groupId?has_content && sourcedType.artifactId?has_content>
2828
Provider:: `${sourcedType.groupId}:${sourcedType.artifactId}`
2929

30-
</#if>${(type.description.text)!}
30+
</#if>${(type.description.text)!'N/A'}
3131

3232
[#${type.className?replace('.', '_')}-XML-snippet]
3333
== XML snippet
@@ -48,16 +48,16 @@ ${indent}${attr.name}="${attr.defaultValue!}"${attr?is_last?then(has_elements?th
4848
</#list>
4949
<#if has_elements>
5050
<#list type.elements as element>
51-
<#assign multiplicitySuffix = (element.multiplicity == '*')?then('<!-- multiple occurrences allowed -->','')/>
52-
<#assign elementName = 'a-' + element.type?keep_after_last('.') + '-implementation'/>
5351
<#if lookup[element.type]??>
5452
<#assign element_type = lookup[element.type].type/>
5553
<#-- @ftlvariable name="element_type" type="org.apache.logging.log4j.docgen.model.AbstractType" -->
5654
<#if element_type.name?? && !element_type.implementations?has_content>
57-
<#assign elementName = element_type.name/>
55+
<#-- @ftlvariable name="element_type" type="org.apache.logging.log4j.docgen.model.PluginType" -->
56+
<${element_type.name}/>
57+
<#else>
58+
<a-${element.type?keep_after_last('.')}-implementation/><#if element.multiplicity == '*'><!-- multiple occurrences allowed --></#if>
5859
</#if>
5960
</#if>
60-
<${elementName}/>${multiplicitySuffix}
6161
</#list>
6262
</${type.name}>
6363
</#if>
@@ -68,18 +68,17 @@ ${indent}${attr.name}="${attr.defaultValue!}"${attr?is_last?then(has_elements?th
6868
[#${type.className?replace('.', '_')}-attributes]
6969
== Attributes
7070

71-
Optional attributes are denoted by `?`-suffixed types.
71+
Required attributes are in **bold face**.
7272

7373
[cols="1m,1m,1m,5"]
7474
|===
7575
|Name|Type|Default|Description
7676

7777
<#list type.attributes?sort_by('name') as attr>
78-
<#assign requirementSuffix = attr.required?then('', '?')/>
79-
|${attr.name}
80-
|xref:../../scalars.adoc#${attr.type?replace('.', '_')}[${attr.type?contains('.')?then(attr.type?keep_after_last('.'), attr.type)}]${requirementSuffix}
78+
|${attr.required?then('**', '')}${attr.name}${attr.required?then('**', '')}
79+
|xref:../../scalars.adoc#${attr.type?replace('.', '_')}[${attr.type?contains('.')?then(attr.type?keep_after_last('.'), attr.type)}]
8180
|${attr.defaultValue!}
82-
a|${(attr.description.text)!}
81+
a|${(attr.description.text)!'N/A'}
8382

8483
</#list>
8584
|===
@@ -89,41 +88,19 @@ a|${(attr.description.text)!}
8988
[#${type.className?replace('.', '_')}-components]
9089
== Nested components
9190

92-
Optional components are denoted by `?`-suffixed types.
91+
Required components are in **bold face**.
9392

9493
[cols="1m,1m,5"]
9594
|===
9695
|Tag|Type|Description
9796

9897
<#list type.elements?sort_by('type') as element>
99-
<#assign requirementSuffix = element.required?then('', '?')/>
100-
<#assign descriptionCell = (element.description.text)!/>
101-
<#assign elementName = element.type?contains('.')?then(element.type?keep_after_last('.'), element.type)/>
10298
<#if lookup[element.type]??>
103-
<#assign elementSourcedType = lookup[element.type]/>
104-
<#assign elementType = elementSourcedType.type/>
105-
<#assign tagCell = elementType.name!/>
106-
<#switch elementType.class.simpleName>
107-
<#case 'PluginType'>
108-
<#case 'AbstractType'>
109-
|${tagCell}
110-
|xref:../../${elementSourcedType.groupId}/${elementSourcedType.artifactId}/${element.type}.adoc[${elementName}]${requirementSuffix}
111-
a|${descriptionCell}
112-
<#break>
113-
<#case 'ScalarType'>
114-
|${tagCell}
115-
|xref:../scalars.adoc#${element.type?replace('.', '_')}[${elementName}]${requirementSuffix}
116-
a|${descriptionCell}
117-
<#break>
118-
<#default>
119-
<#stop 'Unknown type `' + element.type + '` modelled in class `' + elementType.class.name + '`'/>
120-
</#switch>
121-
<#else>
122-
|
123-
|${elementName}${requirementSuffix}
124-
a|${descriptionCell}
125-
</#if>
99+
|${element.required?then('**', '') + (lookup[element.type].type.name!'N/A') + element.required?then('**', '')}
100+
|xref:${element.type}.adoc[${element.type?contains('.')?then(element.type?keep_after_last('.'), element.type)}]
101+
a|${(element.description.text)!'N/A'}
126102

103+
</#if>
127104
</#list>
128105
|===
129106
</#if>
@@ -133,7 +110,6 @@ a|${descriptionCell}
133110
== Known implementations
134111

135112
<#list type.implementations as impl>
136-
<#assign implSourcedType = lookup[impl]/>
137-
* xref:../../${implSourcedType.groupId}/${implSourcedType.artifactId}/${impl}.adoc[${impl?contains('.')?then(impl?keep_after_last('.'), impl)}]
113+
* xref:${impl}.adoc[${impl?contains('.')?then(impl?keep_after_last('.'), impl)}]
138114
</#list>
139115
</#if>

src/docgen-templates/scalars.adoc.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ Type converter plugins are used to convert simple `String` values into other typ
3232
Provider:: `${sourcedType.groupId}:${sourcedType.artifactId}`
3333
</#if>
3434

35-
${(scalar.description.text)!}
35+
${scalar.description.text}
3636
<#if scalar.values?size != 0>
3737

3838
[#${scalar.className?replace('.', '_')}-values]
3939
=== Possible values
4040

4141
<#list scalar.values as value>
42-
`${value.name}`:: ${(value.description.text)!}
42+
`${value.name}`:: ${(value.description.text)!'N/A'}
4343
</#list>
4444
</#if>
4545
</#list>

0 commit comments

Comments
 (0)