From b457013f9bb3fc7eb3fa3a09b70aea1da4ed91ff Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 3 Apr 2023 23:33:49 +0800 Subject: [PATCH] Create a shadow asciidoctor executable for this project --- gems/templates/admonition.html.erb | 23 +++++++++++++++++++++++ gems/templates/paragraph.html.erb | 6 ++++++ shell.nix | 6 ++++++ 3 files changed, 35 insertions(+) create mode 100644 gems/templates/admonition.html.erb create mode 100644 gems/templates/paragraph.html.erb diff --git a/gems/templates/admonition.html.erb b/gems/templates/admonition.html.erb new file mode 100644 index 0000000..4788308 --- /dev/null +++ b/gems/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/gems/templates/paragraph.html.erb b/gems/templates/paragraph.html.erb new file mode 100644 index 0000000..e548e55 --- /dev/null +++ b/gems/templates/paragraph.html.erb @@ -0,0 +1,6 @@ + <% if role %>class="<%= role %>"<% end %>><% +if title? %> +
<%= title %>
<% +end %> +<%= content %> +

diff --git a/shell.nix b/shell.nix index 0ed3d97..ed9571f 100644 --- a/shell.nix +++ b/shell.nix @@ -8,6 +8,10 @@ let ruby = ruby_3_1; gemset = ./gemset.nix; }; + + asciidoctorWrappedWithCustomOptions = writeShellScriptBin "asciidoctor" '' + ${lib.getBin localGem.env}/bin/asciidoctor -T ./gems/templates $@ + ''; in mkShell { buildInputs = [ @@ -16,6 +20,8 @@ mkShell { ]; packages = [ + asciidoctorWrappedWithCustomOptions + git go hugo