From c2bcc608667022a5dea9fb91002482da64f08a17 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 3 Nov 2023 16:04:27 +0800 Subject: [PATCH] Modify shadow asciidoctor script --- shell.nix | 5 +++-- templates/admonition.html.erb | 23 +++++++++++++++++++++++ templates/paragraph.html.erb | 6 ++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 templates/admonition.html.erb create mode 100644 templates/paragraph.html.erb diff --git a/shell.nix b/shell.nix index 23a3e8e..e2f9100 100644 --- a/shell.nix +++ b/shell.nix @@ -10,16 +10,16 @@ let }; asciidoctorWrappedWithCustomOptions = writeShellScriptBin "asciidoctor" '' - ${lib.getBin gems}/bin/asciidoctor -T ./gems/templates $@ + ${lib.getBin gems}/bin/asciidoctor -T ${./templates} $@ ''; treesitterWithPlugins = (tree-sitter.withPlugins (_: tree-sitter.allGrammars)); in mkShell { packages = [ + asciidoctorWrappedWithCustomOptions gems gems.wrappedRuby - asciidoctorWrappedWithCustomOptions git libgit2 @@ -48,6 +48,7 @@ mkShell { shellHook = '' go version hugo version + which asciidoctor asciidoctor --version chmod u+x --recursive ./bin diff --git a/templates/admonition.html.erb b/templates/admonition.html.erb new file mode 100644 index 0000000..4788308 --- /dev/null +++ b/templates/admonition.html.erb @@ -0,0 +1,23 @@ + class="<%= ['admonitionblock',(attr :name),role].compact * ' ' %>"> + + + + + +
<% + if document.attr? :icons, 'font' %> + <% + elsif document.attr? :icons %> + + + <% + else %> +
<%= @caption %>
<% + end %> +
<% + if title? %> +
<%= title %>
<% + end %> + <%= content %> +
+ diff --git a/templates/paragraph.html.erb b/templates/paragraph.html.erb new file mode 100644 index 0000000..e548e55 --- /dev/null +++ b/templates/paragraph.html.erb @@ -0,0 +1,6 @@ + <% if role %>class="<%= role %>"<% end %>><% +if title? %> +
<%= title %>
<% +end %> +<%= content %> +