Skip to content

Commit 0c94539

Browse files
authored
Migrate 3.x website to Antora (#2443)
1 parent e8d544e commit 0c94539

File tree

186 files changed

+2986
-9604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+2986
-9604
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ velocity.log
3535
felix-cache/
3636
/.metadata/
3737
.DS_Store
38+
node
39+
node_modules
40+
package-lock.json

BUILDING.adoc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,7 @@ You can build the website and manual as follows:
6262
./mvnw site
6363
----
6464
65-
And view it using a simple HTTP server, e.g., the one comes with the Python:
66-
67-
[source,bash]
68-
----
69-
python3 -m http.server -d target/site
70-
----
65+
You can view the generated website with a browser by pointing it to `target/site` directory.
7166
7267
[#development]
7368
== Development

antora-playbook.yaml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to you under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
site:
19+
title: Apache Log4j
20+
url: "https://logging.apache.org/log4j/3.x"
21+
start_page: "ROOT::index.adoc"
22+
23+
content:
24+
sources:
25+
- url: .
26+
branches: HEAD
27+
start_paths:
28+
- target/generated-site/antora
29+
edit_url:
30+
31+
asciidoc:
32+
attributes:
33+
# JSON Template Layout manual page has a deep sectioning, support it.
34+
# The trailing `@` is added so the attribute can still can be overridden in the header of a page.
35+
# For instance, we override this value in release notes page.
36+
page-toclevels: "4@"
37+
log4j-docgen-descriptor-directory: target/plugin-descriptors
38+
log4j-docgen-type-filter-exclude-pattern: ^java\..+
39+
log4j-docgen-type-target-template: |
40+
#{{{replaceAll sourcedType.groupId "." "-"}}}_{{{replaceAll sourcedType.artifactId "." "-"}}}_{{{replaceAll sourcedType.type.className "." "-"}}}
41+
extensions:
42+
- "@asciidoctor/tabs"
43+
- src/docgen/apiref-macro.js
44+
45+
ui:
46+
47+
bundle:
48+
url: "https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable"
49+
snapshot: true
50+
51+
# Template files: https://github.com/asciidoctor/asciidoctor-docs-ui/blob/main/src
52+
# Template variables: https://docs.antora.org/antora-ui-default/templates
53+
supplemental_files:
54+
55+
# Add `@asciidoctor/tabs` extension styles
56+
- path: css/vendor/tabs.css
57+
contents: ./node_modules/@asciidoctor/tabs/dist/css/tabs.css
58+
59+
# Add `@asciidoctor/tabs` extension scripts
60+
- path: js/vendor/tabs.js
61+
contents: ./node_modules/@asciidoctor/tabs/dist/js/tabs.js
62+
63+
- path: partials/footer-scripts.hbs
64+
contents: |
65+
<script id="site-script" src="{{{uiRootPath}}}/js/site.js" data-ui-root-path="{{{uiRootPath}}}"></script>
66+
<script async src="{{{uiRootPath}}}/js/vendor/highlight.js"></script>
67+
<!-- `@asciidoctor/tabs` extension scripts -->
68+
<script async src="{{{uiRootPath}}}/js/vendor/tabs.js"></script>
69+
{{#if env.SITE_SEARCH_PROVIDER}}
70+
{{> search-scripts}}
71+
{{/if}}
72+
73+
- path: partials/head-styles.hbs
74+
contents: |
75+
<link rel="stylesheet" href="{{{uiRootPath}}}/css/site.css">
76+
<link rel="icon" href="{{{uiRootPath}}}/../_images/favicon.ico" type="image/x-icon">
77+
<!-- `@asciidoctor/tabs` extension styles -->
78+
<link rel="stylesheet" href="{{{uiRootPath}}}/css/vendor/tabs.css">
79+
<style>
80+
/* `page-toclevels` greater than 4 are not supported by Antora UI, patching it: */
81+
.toc .toc-menu li[data-level="4"] a {
82+
padding-left: 2.75rem
83+
}
84+
/* Replace the default highlight.js color for strings from red to green: */
85+
.hljs-string {
86+
color: #0f8532;
87+
}
88+
</style>
89+
90+
- path: partials/header-content.hbs
91+
contents: |
92+
<header class="header">
93+
<nav class="navbar">
94+
<div class="navbar-brand">
95+
<div class="navbar-item">
96+
<img src="{{{uiRootPath}}}/../_images/logo-small-white.png" alt="Apache Log4j"/>
97+
</div>
98+
</div>
99+
</nav>
100+
</header>
101+
102+
- path: partials/footer-content.hbs
103+
contents: |
104+
<footer class="footer">
105+
<p>
106+
Copyright © 1999-{{{year}}} <a href="https://www.apache.org/">The Apache Software Foundation</a>.
107+
Licensed under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache Software License, Version 2.0</a>.
108+
Please read our <a href="https://privacy.apache.org/policies/privacy-policy-public.html">privacy policy</a>.
109+
</p>
110+
<p>
111+
Apache, Log4j, and the Apache feather logo are trademarks or registered trademarks of The Apache Software Foundation.
112+
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
113+
Other names may be trademarks of their respective owners.
114+
</p>
115+
</footer>
116+
117+
# Disable component version selector
118+
- path: partials/nav-explore.hbs
119+
contents: ""
120+
121+
# Fix the `Edit this page` link
122+
- path: partials/edit-this-page.hbs
123+
contents: |
124+
<div class="edit-this-page"><a href="https://github.com/apache/logging-log4j2/edit/main/src/site/antora/modules/{{page.module}}/pages/{{page.relativeSrcPath}}">Edit this Page</a></div>

log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/MaxLengthConverter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
* On invalid length the default value 100 is used (and an error message is logged).
3131
* If max length is greater than 20, an abbreviated text will get ellipsis ("...") appended.
3232
* Example usage (for email subject):
33-
* {@code "%maxLen{[AppName, ${hostName}, ${web:contextPath}] %p: %c{1} - %m%notEmpty{ =>%ex{short}}}{160}"}
33+
* <pre>{@code
34+
* %maxLen{[AppName, ${hostName}, ${web:contextPath}] %p: %c{1} - %m%notEmpty{ =>%ex{short}}}{160}
35+
* }</pre>
3436
*
3537
* @author Thies Wellpott
3638
*/

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"dependencies": {
3+
"@antora/cli": "^3.2.0-alpha.4",
4+
"@antora/site-generator-default": "^3.2.0-alpha.4",
5+
"@asciidoctor/tabs": "^1.0.0-beta.6",
6+
"fast-xml-parser": "^4.3.6",
7+
"handlebars": "^4.7.8"
8+
}
9+
}

0 commit comments

Comments
 (0)