This is an automated email from the ASF dual-hosted git repository. grobmeier pushed a commit to branch ms12_conversion_of_md_files in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 5bc3db427a4c8b2a783f21b167c188a7f7f4471f Author: Christian Grobmeier <[email protected]> AuthorDate: Sat Feb 24 10:39:30 2024 +0100 added example for source code highlightin --- pom.xml | 2 +- src/asciidoc/templates/document.html.erb | 9 +++------ src/site/asciidoc/index.adoc | 11 ++++++++++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 0cd4fdf4ba..7babd14b55 100644 --- a/pom.xml +++ b/pom.xml @@ -795,12 +795,12 @@ <sourceDirectory>src/site/asciidoc</sourceDirectory> <outputDirectory>target/site</outputDirectory> <preserveDirectories>true</preserveDirectories> - <templateDirs> <dir>src/asciidoc/templates</dir> </templateDirs> <attributes> + <source-highlighter>rouge</source-highlighter> <icons>font</icons> <iconfont-remote>never</iconfont-remote> <iconfont-name>font-awesome</iconfont-name> diff --git a/src/asciidoc/templates/document.html.erb b/src/asciidoc/templates/document.html.erb index a83cc9b6a5..eb8b3bd777 100644 --- a/src/asciidoc/templates/document.html.erb +++ b/src/asciidoc/templates/document.html.erb @@ -39,16 +39,13 @@ <link rel="stylesheet" href="<%= normalize_web_path((attr :stylesheet), attr(:stylesdir, '')) %>"> <% end - %> - <% + if attr? :icons, 'font' %> <link rel="stylesheet" href="<%= normalize_web_path(%(#{attr 'iconfont-name', 'font-awesome'}.css), (attr :stylesdir, '')) %>"><% end %> - <!-- Coderay CSS --> - <style> - <%= Asciidoctor::Stylesheets.instance.coderay_stylesheet_data %> - </style> + <!-- Code Highlighter --> + <%= syntax_highlighter&.docinfo :head, self, {} %> <%= (docinfo_content = docinfo).empty? ? nil : %(#{docinfo_content}) %> </head> <body<%= @id && %( id="#{@id}") %> class="<%= [(attr :doctype),((attr? 'toc-class') && (attr? :toc) && (attr? 'toc-placement', 'auto') ? %(#{attr 'toc-class'} toc-#{attr 'toc-position', 'left'}) : nil)].compact * ' ' %>"<%= (attr? 'max-width') ? %( style="max-width: #{attr 'max-width'};") : nil %>><% diff --git a/src/site/asciidoc/index.adoc b/src/site/asciidoc/index.adoc index 569f639436..d26fceb917 100644 --- a/src/site/asciidoc/index.adoc +++ b/src/site/asciidoc/index.adoc @@ -24,7 +24,7 @@ The project is actively maintained by a link:team.html[team] of several voluntee [#links] == Quick links - link:maven-artifacts.html[How can I add Log4j artifacts to my Maven/Ivy/Gradle project?] -- link:manual/usage.html?[How can I use the Log4j API?] +- link:manual/usage.html[How can I use the Log4j API?] - link:manual/configuration.html[How can I configure my `log4j2.xml`?] - link:release-notes.html[Where are the release notes?] - link:support.html[**I need help!**] @@ -34,6 +34,15 @@ The project is actively maintained by a link:team.html[team] of several voluntee We share below some highlights from Log4j features. +[source, java] +---- +class Test { + public void some() { + System.out.println("Hello"); + } +} +---- + Batteries included:: Log4j bundles a rich set of components to assist various use cases. * link:manual/appenders.html[Appenders] targeting files, network sockets, databases, SMTP servers, etc.
