This is an automated email from the ASF dual-hosted git repository. vy pushed a commit to branch 2.x in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 27b76497f07dd66fff6e830437f8acf3b5e4c64b Author: Volkan Yazıcı <[email protected]> AuthorDate: Thu Feb 29 17:11:52 2024 +0100 Revert "Adapt the most recent docgen changes" This reverts commit cdae032ae47c15e8f7f875b35b81ef1d1a9bbbfb. --- pom.xml | 36 ++++++++-------------- src/docgen-templates/interface.adoc.ftl | 3 +- src/docgen-templates/plugin.adoc.ftl | 54 +++++++++------------------------ src/docgen-templates/scalars.adoc.ftl | 4 +-- 4 files changed, 31 insertions(+), 66 deletions(-) diff --git a/pom.xml b/pom.xml index 199fcd417b..ce70851308 100644 --- a/pom.xml +++ b/pom.xml @@ -334,7 +334,7 @@ <maven.site.deploy.skip>true</maven.site.deploy.skip> <!-- Dependency versions --> - <log4j-docgen.version>1.0.0-SNAPSHOT</log4j-docgen.version> + <log4j-docgen.version>0.8.0-SNAPSHOT</log4j-docgen.version> <!-- Versions of libraries whose plugin descriptors will be documented: --> <docgen.log4j.version>2.23.0-SNAPSHOT</docgen.log4j.version> @@ -873,25 +873,7 @@ <artifactId>log4j-docgen-maven-plugin</artifactId> <version>${log4j-docgen.version}</version> <inherited>false</inherited> - - <!-- Common docgen configuration --> - <configuration> - <descriptorFileMatchers> - <descriptorFileMatcher> - <baseDirectory>${project.build.directory}/plugin-descriptors</baseDirectory> - <pathPatterns>glob:**/*.xml</pathPatterns> - </descriptorFileMatcher> - </descriptorFileMatchers> - <typeFilter> - <excludes> - <exclude>java\..+</exclude> - </excludes> - </typeFilter> - </configuration> - <executions> - - <!-- Generate AsciiDoc from download plugin descriptors --> <execution> <id>generate-plugin-docs</id> <goals> @@ -899,6 +881,12 @@ </goals> <phase>pre-site</phase> <configuration> + <descriptorFileMatchers> + <descriptorFileMatcher> + <baseDirectory>${project.build.directory}/plugin-descriptors</baseDirectory> + <pathPatterns>glob:**/*.xml</pathPatterns> + </descriptorFileMatcher> + </descriptorFileMatchers> <templateDirectory>${project.basedir}/src/docgen-templates</templateDirectory> <scalarsTemplate> <source>scalars.adoc.ftl</source> @@ -914,8 +902,6 @@ </pluginTemplate> </configuration> </execution> - - <!-- Generate XSD from download plugin descriptors --> <execution> <id>generate-plugin-schema</id> <goals> @@ -923,12 +909,16 @@ </goals> <phase>pre-site</phase> <configuration> + <descriptorFileMatchers> + <descriptorFileMatcher> + <baseDirectory>${project.build.directory}/plugin-descriptors</baseDirectory> + <pathPatterns>glob:**/*.xml</pathPatterns> + </descriptorFileMatcher> + </descriptorFileMatchers> <schemaFile>${project.build.directory}/generated-sources/site/resources/config.xsd</schemaFile> </configuration> </execution> - </executions> - </plugin> <plugin> diff --git a/src/docgen-templates/interface.adoc.ftl b/src/docgen-templates/interface.adoc.ftl index cfa565913c..53020979e8 100644 --- a/src/docgen-templates/interface.adoc.ftl +++ b/src/docgen-templates/interface.adoc.ftl @@ -35,6 +35,5 @@ ${type.description.text} == Known implementations <#list type.implementations as impl> - <#assign implSourcedType = lookup[impl]/> -* xref:../../${implSourcedType.groupId}/${implSourcedType.artifactId}/${impl}.adoc[${impl?contains('.')?then(impl?keep_after_last('.'), impl)}] +* xref:${impl}.adoc[${impl?contains('.')?then(impl?keep_after_last('.'), impl)}] </#list> diff --git a/src/docgen-templates/plugin.adoc.ftl b/src/docgen-templates/plugin.adoc.ftl index 9e34731833..f7d54b461d 100644 --- a/src/docgen-templates/plugin.adoc.ftl +++ b/src/docgen-templates/plugin.adoc.ftl @@ -27,7 +27,7 @@ Class:: `${type.className}` <#if sourcedType.groupId?has_content && sourcedType.artifactId?has_content> Provider:: `${sourcedType.groupId}:${sourcedType.artifactId}` -</#if>${(type.description.text)!} +</#if>${(type.description.text)!'N/A'} [#${type.className?replace('.', '_')}-XML-snippet] == XML snippet @@ -48,16 +48,16 @@ ${indent}${attr.name}="${attr.defaultValue!}"${attr?is_last?then(has_elements?th </#list> <#if has_elements> <#list type.elements as element> - <#assign multiplicitySuffix = (element.multiplicity == '*')?then('<!-- multiple occurrences allowed -->','')/> - <#assign elementName = 'a-' + element.type?keep_after_last('.') + '-implementation'/> <#if lookup[element.type]??> <#assign element_type = lookup[element.type].type/> <#-- @ftlvariable name="element_type" type="org.apache.logging.log4j.docgen.model.AbstractType" --> <#if element_type.name?? && !element_type.implementations?has_content> - <#assign elementName = element_type.name/> + <#-- @ftlvariable name="element_type" type="org.apache.logging.log4j.docgen.model.PluginType" --> + <${element_type.name}/> + <#else> + <a-${element.type?keep_after_last('.')}-implementation/><#if element.multiplicity == '*'><!-- multiple occurrences allowed --></#if> </#if> </#if> - <${elementName}/>${multiplicitySuffix} </#list> </${type.name}> </#if> @@ -68,18 +68,17 @@ ${indent}${attr.name}="${attr.defaultValue!}"${attr?is_last?then(has_elements?th [#${type.className?replace('.', '_')}-attributes] == Attributes -Optional attributes are denoted by `?`-suffixed types. +Required attributes are in **bold face**. [cols="1m,1m,1m,5"] |=== |Name|Type|Default|Description <#list type.attributes?sort_by('name') as attr> - <#assign requirementSuffix = attr.required?then('', '?')/> -|${attr.name} -|xref:../../scalars.adoc#${attr.type?replace('.', '_')}[${attr.type?contains('.')?then(attr.type?keep_after_last('.'), attr.type)}]${requirementSuffix} +|${attr.required?then('**', '')}${attr.name}${attr.required?then('**', '')} +|xref:../../scalars.adoc#${attr.type?replace('.', '_')}[${attr.type?contains('.')?then(attr.type?keep_after_last('.'), attr.type)}] |${attr.defaultValue!} -a|${(attr.description.text)!} +a|${(attr.description.text)!'N/A'} </#list> |=== @@ -89,41 +88,19 @@ a|${(attr.description.text)!} [#${type.className?replace('.', '_')}-components] == Nested components -Optional components are denoted by `?`-suffixed types. +Required components are in **bold face**. [cols="1m,1m,5"] |=== |Tag|Type|Description <#list type.elements?sort_by('type') as element> - <#assign requirementSuffix = element.required?then('', '?')/> - <#assign descriptionCell = (element.description.text)!/> - <#assign elementName = element.type?contains('.')?then(element.type?keep_after_last('.'), element.type)/> <#if lookup[element.type]??> - <#assign elementSourcedType = lookup[element.type]/> - <#assign elementType = elementSourcedType.type/> - <#assign tagCell = elementType.name!/> - <#switch elementType.class.simpleName> - <#case 'PluginType'> - <#case 'AbstractType'> -|${tagCell} -|xref:../../${elementSourcedType.groupId}/${elementSourcedType.artifactId}/${element.type}.adoc[${elementName}]${requirementSuffix} -a|${descriptionCell} - <#break> - <#case 'ScalarType'> -|${tagCell} -|xref:../scalars.adoc#${element.type?replace('.', '_')}[${elementName}]${requirementSuffix} -a|${descriptionCell} - <#break> - <#default> - <#stop 'Unknown type `' + element.type + '` modelled in class `' + elementType.class.name + '`'/> - </#switch> - <#else> -| -|${elementName}${requirementSuffix} -a|${descriptionCell} - </#if> +|${element.required?then('**', '') + (lookup[element.type].type.name!'N/A') + element.required?then('**', '')} +|xref:${element.type}.adoc[${element.type?contains('.')?then(element.type?keep_after_last('.'), element.type)}] +a|${(element.description.text)!'N/A'} + </#if> </#list> |=== </#if> @@ -133,7 +110,6 @@ a|${descriptionCell} == Known implementations <#list type.implementations as impl> - <#assign implSourcedType = lookup[impl]/> -* xref:../../${implSourcedType.groupId}/${implSourcedType.artifactId}/${impl}.adoc[${impl?contains('.')?then(impl?keep_after_last('.'), impl)}] +* xref:${impl}.adoc[${impl?contains('.')?then(impl?keep_after_last('.'), impl)}] </#list> </#if> diff --git a/src/docgen-templates/scalars.adoc.ftl b/src/docgen-templates/scalars.adoc.ftl index 9b5edb9add..cb581261cc 100644 --- a/src/docgen-templates/scalars.adoc.ftl +++ b/src/docgen-templates/scalars.adoc.ftl @@ -32,14 +32,14 @@ Type converter plugins are used to convert simple `String` values into other typ Provider:: `${sourcedType.groupId}:${sourcedType.artifactId}` </#if> -${(scalar.description.text)!} +${scalar.description.text} <#if scalar.values?size != 0> [#${scalar.className?replace('.', '_')}-values] === Possible values <#list scalar.values as value> -`${value.name}`:: ${(value.description.text)!} +`${value.name}`:: ${(value.description.text)!'N/A'} </#list> </#if> </#list>
