This is an automated email from the ASF dual-hosted git repository. vy pushed a commit to branch 3.x-docgen in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit b5d5f44e8767b6546947731f464f61411210255f Author: Volkan Yazıcı <[email protected]> AuthorDate: Mon Mar 25 11:20:02 2024 +0100 Adopt changes for `log4j-docgen` version `0.8.0` release --- pom.xml | 9 ++++----- src/docgen-templates/index.adoc.ftl | 13 ++++++------- src/docgen-templates/license.adoc | 16 ---------------- src/docgen-templates/type.adoc.ftl | 29 ++++++++--------------------- src/site/asciidoc/plugin-reference.adoc | 22 ++++++++++++++++++++++ 5 files changed, 40 insertions(+), 49 deletions(-) diff --git a/pom.xml b/pom.xml index 2ecf5aa229..d8c89eda57 100644 --- a/pom.xml +++ b/pom.xml @@ -784,6 +784,7 @@ </plugin> <plugin> + <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-docgen-maven-plugin</artifactId> <version>${log4j-docgen.version}</version> @@ -838,12 +839,11 @@ <templateDirectory>${project.basedir}/src/docgen-templates</templateDirectory> <indexTemplate> <source>index.adoc.ftl</source> - <target>${project.build.directory}/generated-sources/site/asciidoc/plugin-reference/index.adoc</target> + <target>${project.build.directory}/generated-sources/site/asciidoc/plugin-reference.adoc</target> </indexTemplate> <typeTemplate> <source>type.adoc.ftl</source> - <!-- `target` must be in sync. with the `log4j-docgen-type-template-target` configuration of `log4j-docgen-asciidoctor-extension`! --> - <target>${project.build.directory}/generated-sources/site/asciidoc/plugin-reference/%g/%a/%c.adoc</target> + <target>${project.build.directory}/generated-sources/site/asciidoc/_plugin-reference/%g-%a-%c.adoc</target> </typeTemplate> </configuration> </execution> @@ -913,8 +913,7 @@ <toc>left</toc> <log4j-docgen-descriptor-directory>${project.build.directory}/plugin-descriptors</log4j-docgen-descriptor-directory> <log4j-docgen-type-filter-exclude-pattern>${log4j.docgen.typeFilter.excludePattern}</log4j-docgen-type-filter-exclude-pattern> - <!-- `log4j-docgen-type-template-target` must be in sync. with the `typeTemplate` configuration of `log4j-docgen-maven-plugin`! --> - <log4j-docgen-type-template-target>../../%g/%a/%c.html</log4j-docgen-type-template-target> + <log4j-docgen-type-target-template><![CDATA[#${sourcedType.groupId?replace('.', '-')}_${sourcedType.artifactId?replace('.', '-')}_${sourcedType.type.className?replace('.', '-')}]]></log4j-docgen-type-target-template> </attributes> </configuration> </execution> diff --git a/src/docgen-templates/index.adoc.ftl b/src/docgen-templates/index.adoc.ftl index 48e8d0fd3b..9dc1d8c733 100644 --- a/src/docgen-templates/index.adoc.ftl +++ b/src/docgen-templates/index.adoc.ftl @@ -16,7 +16,6 @@ See the License for the specific language governing permissions and limitations under the License. --> <#-- @ftlvariable name="lookup" type="org.apache.logging.log4j.docgen.generator.TypeLookup" --> -<#include "license.adoc"> = Plugin reference @@ -33,10 +32,10 @@ This not only allows Log4j itself to be developed in individual components, but [#shortcuts] == Shortcuts -* xref:org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.config.Configuration.adoc[The `<Configuration>` element assembly in a `log4j2.xml`] -* xref:org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.Appender.adoc[The type hierarchy of *appenders*] -* xref:org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.Layout.adoc[The type hierarchy of *layouts*] -* xref:org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.Filter.adoc[The type hierarchy of *filters*] +* xref:#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-Configuration[The `<Configuration>` element assembly in a `log4j2.xml`] +* xref:#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-Appender[The type hierarchy of *appenders*] +* xref:#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-Layout[The type hierarchy of *layouts*] +* xref:#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-Filter[The type hierarchy of *filters*] [#index] == Index @@ -52,9 +51,9 @@ Below is a list of all types reachable by plugins grouped by the Maven coordinat <#assign lastGroupId = sourcedType.groupId/> <#assign lastArtifactId = sourcedType.artifactId/> -[#${sourcedType.groupId?replace('.', '_')}-${sourcedType.artifactId?replace('.', '_')}] +[#${sourcedType.groupId?replace('.', '-')}_${sourcedType.artifactId?replace('.', '-')}] === `${sourcedType.groupId}:${sourcedType.artifactId}` </#if> -* xref:${sourcedType.groupId}/${sourcedType.artifactId}/${sourcedType.type.className}.adoc[`${sourcedType.type.className}`] +include::_plugin-reference/${sourcedType.groupId}-${sourcedType.artifactId}-${sourcedType.type.className}.adoc[leveloffset=+4] </#list> diff --git a/src/docgen-templates/license.adoc b/src/docgen-templates/license.adoc deleted file mode 100644 index 797f7c9fb7..0000000000 --- a/src/docgen-templates/license.adoc +++ /dev/null @@ -1,16 +0,0 @@ -//// -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -//// diff --git a/src/docgen-templates/type.adoc.ftl b/src/docgen-templates/type.adoc.ftl index 3c087e7a96..48f8dc2478 100644 --- a/src/docgen-templates/type.adoc.ftl +++ b/src/docgen-templates/type.adoc.ftl @@ -19,23 +19,19 @@ <#assign type = sourcedType.type/> <#-- @ftlvariable name="type" type="org.apache.logging.log4j.docgen.Type" --> <#-- @ftlvariable name="lookup" type="org.apache.logging.log4j.docgen.generator.TypeLookup" --> -<#include "license.adoc"> -[#${type.className?replace('.', '_')}] +[#${sourcedType.groupId?replace('.', '-')}_${sourcedType.artifactId?replace('.', '-')}_${type.className?replace('.', '-')}] = ${type.name!('`' + type.className + '`')} Class:: `${type.className}` -<#if sourcedType.groupId?has_content && sourcedType.artifactId?has_content> Provider:: `${sourcedType.groupId}:${sourcedType.artifactId}` -</#if> - ${(type.description.text)!} <#assign hasElements = ((type.elements?size)!0) != 0/> <#if type.class.simpleName == 'PluginType'> <#-- @ftlvariable name="type" type="org.apache.logging.log4j.docgen.PluginType" --> -[#${type.className?replace('.', '_')}-XML-snippet] +[#${sourcedType.groupId?replace('.', '-')}_${sourcedType.artifactId?replace('.', '-')}_${type.className?replace('.', '-')}_XML-snippet] == XML snippet [source, xml] ---- @@ -71,7 +67,7 @@ ${indent}${attr.name}="${attr.defaultValue!}"${attr?is_last?then(hasElements?the </#if> <#if type.attributes?has_content> -[#${type.className?replace('.', '_')}-attributes] +[#${sourcedType.groupId?replace('.', '-')}_${sourcedType.artifactId?replace('.', '-')}_${type.className?replace('.', '-')}-attributes] == Attributes Optional attributes are denoted by `?`-suffixed types. @@ -86,7 +82,7 @@ Optional attributes are denoted by `?`-suffixed types. <#assign attrTypeName = attr.type?contains('.')?then(attr.type?keep_after_last('.'), attr.type)/> <#if lookup[attr.type]??> <#assign attrSourcedType = lookup[attr.type]/> -|xref:../../${attrSourcedType.groupId}/${attrSourcedType.artifactId}/${attr.type}.adoc[${attrTypeName}]${requirementSuffix} +|xref:#${attrSourcedType.groupId?replace('.', '-')}_${attrSourcedType.artifactId?replace('.', '-')}_${attr.type?replace('.', '-')}[${attrTypeName}]${requirementSuffix} <#else> |${attrTypeName}${requirementSuffix} </#if> @@ -98,7 +94,7 @@ a|${(attr.description.text)!} </#if> <#if hasElements> -[#${type.className?replace('.', '_')}-components] +[#${sourcedType.groupId?replace('.', '-')}_${sourcedType.artifactId?replace('.', '-')}_${type.className?replace('.', '-')}_components] == Nested components Optional components are denoted by `?`-suffixed types. @@ -115,7 +111,7 @@ Optional components are denoted by `?`-suffixed types. <#assign elementSourcedType = lookup[element.type]/> <#assign tagCell = elementSourcedType.type.name!/> |${tagCell} -|xref:../../${elementSourcedType.groupId}/${elementSourcedType.artifactId}/${element.type}.adoc[${elementName}]${requirementSuffix} +|xref:#${elementSourcedType.groupId?replace('.', '-')}_${elementSourcedType.artifactId?replace('.', '-')}_${element.type?replace('.', '-')}[${elementName}]${requirementSuffix} <#else> | |${elementName}${requirementSuffix} @@ -127,20 +123,11 @@ a|${descriptionCell} </#if> <#if type.implementations?has_content> -[#${type.className?replace('.', '_')}-implementations] +[#${sourcedType.groupId?replace('.', '-')}_${sourcedType.artifactId?replace('.', '-')}_${type.className?replace('.', '-')}_implementations] == 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:#${implSourcedType.groupId?replace('.', '-')}_${implSourcedType.artifactId?replace('.', '-')}_${impl?replace('.', '-')}[${impl?contains('.')?then(impl?keep_after_last('.'), impl)}] </#list> </#if> - -[#shortcuts] -== Shortcuts - -* xref:../../index.adoc[The plugin reference] -* xref:../../org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.config.Configuration.adoc[The `<Configuration>` element assembly in a `log4j2.xml`] -* xref:../../org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.Appender.adoc[The type hierarchy of *appenders*] -* xref:../../org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.Layout.adoc[The type hierarchy of *layouts*] -* xref:../../org.apache.logging.log4j/log4j-core/org.apache.logging.log4j.core.Filter.adoc[The type hierarchy of *filters*] diff --git a/src/site/asciidoc/plugin-reference.adoc b/src/site/asciidoc/plugin-reference.adoc new file mode 100644 index 0000000000..f41b0bbfba --- /dev/null +++ b/src/site/asciidoc/plugin-reference.adoc @@ -0,0 +1,22 @@ +// vim: set syn=markdown : + +//// +Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +//// += Plugin reference + +This file is a stub. +Its content will be auto-generated during build.
