docs/site: add Asciidoctor templates for custom wrapper

This commit is contained in:
Gabriel Arazas 2023-07-09 13:18:13 +08:00
parent 8f3709b335
commit fc9b172c7d
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
3 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,23 @@
<div<%= @id && %( id="#{@id}") %> class="<%= ['admonitionblock',(attr :name),role].compact * ' ' %>">
<table>
<tr>
<td class="icon"><%
if document.attr? :icons, 'font' %>
<i class="icon-<%= attr 'name' %>" title="<%= @caption %>"></i><%
elsif document.attr? :icons %>
<svg class="icon">
<use href="<%= icon_uri(attr :name) %>#<%= attr :name %>" alt="<%= @caption %>"></use>
</svg><%
else %>
<div class="title"><%= @caption %></div><%
end %>
</td>
<td class="content"><%
if title? %>
<div class="title"><%= title %></div><%
end %>
<%= content %>
</td>
</tr>
</table>
</div>

View File

@ -0,0 +1,6 @@
<p<%= @id && %( id="#{@id}") %> <% if role %>class="<%= role %>"<% end %>><%
if title? %>
<div class="title"><%= title %></div><%
end %>
<%= content %>
</p>

View File

@ -3,6 +3,10 @@
with pkgs;
let
asciidoctorWrapper = writeShellScriptBin "asciidoctor" ''
${lib.getBin gems}/bin/asciidoctor -T ${./assets/templates/asciidoctor}
'';
gems = bundlerEnv {
name = "nixos-config-project-docs";
ruby = ruby_3_1;
@ -15,6 +19,7 @@ mkShell {
gems.wrappedRuby
bundix
asciidoctorWrapper
hugo
go
nodePackages.prettier