mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
docs/site: add Asciidoctor templates for custom wrapper
This commit is contained in:
parent
8f3709b335
commit
fc9b172c7d
23
docs/assets/templates/asciidoctor/admonition.html.erb
Normal file
23
docs/assets/templates/asciidoctor/admonition.html.erb
Normal 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>
|
6
docs/assets/templates/asciidoctor/paragraph.html.erb
Normal file
6
docs/assets/templates/asciidoctor/paragraph.html.erb
Normal file
@ -0,0 +1,6 @@
|
||||
<p<%= @id && %( id="#{@id}") %> <% if role %>class="<%= role %>"<% end %>><%
|
||||
if title? %>
|
||||
<div class="title"><%= title %></div><%
|
||||
end %>
|
||||
<%= content %>
|
||||
</p>
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user