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 2f300ac878e934f344acb9abbebf094ef3682c50
Author: Christian Grobmeier <[email protected]>
AuthorDate: Fri Feb 23 21:18:40 2024 +0100

    added experimental version of custom template
---
 src/asciidoc/templates/document.html.erb | 139 +++++++++++++++++++++++++++++++
 1 file changed, 139 insertions(+)

diff --git a/src/asciidoc/templates/document.html.erb 
b/src/asciidoc/templates/document.html.erb
new file mode 100644
index 0000000000..a83cc9b6a5
--- /dev/null
+++ b/src/asciidoc/templates/document.html.erb
@@ -0,0 +1,139 @@
+<%#
+  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.
+%>
+<%#
+  Code is based on an example found in this repository:
+  
https://github.com/asciidoctor/asciidoctor-backends/blob/master/erb/html5/document.html.erb
+%>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <meta name="generator" content="Asciidoctor <%= attr 'asciidoctor-version' 
%>">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <%
+    [:description, :keywords, :author, :copyright].each do |key|
+      if attr? key %>
+        <meta name="<%= key %>" content="<%= attr key %>"><%
+      end
+    end
+  %>
+  <title><%= doctitle(:sanitize => true) || (attr 'untitled-label') %></title>
+  <%
+  if Asciidoctor::DEFAULT_STYLESHEET_KEYS.include?(attr :stylesheet)
+    %><%= Asciidoctor::Stylesheets.instance.embed_primary_stylesheet %><%
+  elsif attr? :stylesheet %>
+    <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>
+  <%= (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 %>><%
+  unless noheader %>
+  <div id="header"><%
+    if doctype == 'manpage' %>
+      <h1><%= doctitle %> Manual Page</h1><%
+    if (attr? :toc) && (attr? 'toc-placement', 'auto') %>
+        <div id="toc" class="<%= attr 'toc-class', 'toc' %>">
+          <div id="toctitle"><%= attr 'toc-title' %></div>
+          <%= converter.convert self, 'outline' %>
+        </div><%
+    end %>
+      <h2><%= attr 'manname-title' %></h2>
+      <div class="sectionbody">
+        <p><%= %(#{attr :manname} - #{attr :manpurpose}) %></p>
+      </div><%
+    else
+      if has_header?
+        unless notitle %>
+          <h1><%= @header.title %></h1><%
+    end
+    if (attr? :author) || (attr? :revnumber) || (attr? :revdate) || (attr? 
:revremark) %>
+          <div class="details"><%
+            if attr? :author %>
+              <span id="author" class="author"><%= attr :author %></span><br><%
+            if attr? :email %>
+                <span id="email" class="email"><%= sub_macros(attr :email) 
%></span><br><%
+            end
+            if (authorcount = (attr :authorcount).to_i) > 1
+              (2..authorcount).each do |idx| %>
+                  <span id="author<%= idx %>" class="author"><%= attr 
%(author_#{idx}) %></span><br><%
+            if attr?  %(email_#{idx}) %>
+                    <span id="email<%= idx %>" class="email"><%= 
sub_macros(attr %(email_#{idx})) %></span><br><%
+            end
+            end
+            end
+            end
+            if attr? :revnumber %>
+              <span id="revnumber"><%= ((attr 'version-label') || '').downcase 
%> <%= attr :revnumber %><%= attr?(:revdate) ? ',' : '' %></span><%
+            end
+            if attr? :revdate %>
+              <span id="revdate"><%= attr :revdate %></span><%
+            end
+            if attr? :revremark %>
+              <br>
+              <span id="revremark"><%= attr :revremark %></span><%
+            end %>
+          </div><%
+    end
+    end
+    if (attr? :toc) && (attr? 'toc-placement', 'auto') %>
+        <div id="toc" class="<%= attr 'toc-class', 'toc' %>">
+          <div id="toctitle"><%= attr 'toc-title' %></div>
+          <%= converter.convert self, 'outline' %>
+        </div><%
+    end
+    end %>
+  </div><%
+  end %>
+<div id="content">
+  <%= content %>
+</div><%
+  unless !footnotes? || attr?(:nofootnotes) %>
+  <div id="footnotes">
+    <hr><%
+    footnotes.each do |fn| %>
+      <div class="footnote" id="_footnote_<%= fn.index %>">
+        <a href="#_footnoteref_<%= fn.index %>"><%= fn.index %></a>. <%= 
fn.text %>
+      </div><%
+    end %>
+  </div><%
+  end %><%
+  unless nofooter %>
+  <div id="footer">
+    <div id="footer-text"><%
+      if attr? :revnumber %>
+        <%= %(#{attr 'version-label'} #{attr :revnumber}) %><br><%
+      end
+      if attr? 'last-update-label' %>
+        <%= %(#{attr 'last-update-label'} #{attr :docdatetime}) %><%
+      end %><%= (docinfo_content = (docinfo :footer)).empty? ? nil : %(
+    #{docinfo_content}) %>
+    </div>
+  </div><%
+  end %>
+</body>
+</html>
\ No newline at end of file

Reply via email to