dotfiles

My personal dotfiles

commit b8ce0435682589f732f01f148b50326a9bf59dcd
parent c8328286a2d22dc009d2fe5b0be5f6e508e26411
Author: Pablo Emilio Escobar Gaviria <pablo-escobar@riseup.net>
Date:   Wed,  9 Dec 2020 13:14:06 -0300

Simplified the asciidoc templates used by Mutt

Diffstat:
M.config/mutt/asciidoc-template/block_admonition.html.haml | 8+++-----
M.config/mutt/asciidoc-template/block_image.html.haml | 6------
M.config/mutt/asciidoc-template/block_listing.html.haml | 34+---------------------------------
M.config/mutt/asciidoc-template/block_open.html.haml | 7+++----
M.config/mutt/asciidoc-template/block_paragraph.html.haml | 3+--
M.config/mutt/asciidoc-template/block_quote.html.haml | 5+++--
M.config/mutt/asciidoc-template/block_table.html.haml | 14++++++--------
M.config/mutt/asciidoc-template/block_ulist.html.haml | 2+-
M.config/mutt/asciidoc-template/document.html.haml | 3++-
M.config/mutt/asciidoc-template/inline_anchor.html.haml | 10++++++----
M.config/mutt/asciidoc-template/inline_menu.html.haml | 15---------------
11 files changed, 26 insertions(+), 81 deletions(-)
diff --git a/.config/mutt/asciidoc-template/block_admonition.html.haml b/.config/mutt/asciidoc-template/block_admonition.html.haml
@@ -1,5 +1,3 @@
-.admonition{:id => @id, :role => "note", :"aria-label" => (attr :name)}
-  %div{:"aria-hidden" => true}
-    %img.icon{:src => (image_uri "icons/#{attr :name}.svg"), 
-      :alt => (@caption || "#{attr :name} icon")}
-  %div=content
+%dl{:id => @id, :role => "note", :"aria-label" => (attr :name)}
+  %dt=(attr(:name).to_s.capitalize)
+  %dd=content
diff --git a/.config/mutt/asciidoc-template/block_image.html.haml b/.config/mutt/asciidoc-template/block_image.html.haml
@@ -3,13 +3,7 @@
     %figure
       %img{:src => image_uri(attr :target), :alt => (attr :alt), 
         :width => (attr :width), :height => (attr :height)}
-      - if @attributes[1]
-        %figcaption
-          %em=@attributes[1]
 - else
   %figure
     %img{:src => image_uri(attr :target), :alt => (attr :alt), 
       :width => (attr :width), :height => (attr :height)}
-    - if @attributes[1]
-      %figcaption
-        %em=@attributes[1]
diff --git a/.config/mutt/asciidoc-template/block_listing.html.haml b/.config/mutt/asciidoc-template/block_listing.html.haml
@@ -1,33 +1 @@
-- nowrap = !(@document.attr? :prewrap) || (option? :nowrap)
-- if @style == 'source'
-  - code_lang = attr :language, nil, false
-  - code_class = ["language-#{code_lang}"] if code_lang
-  - pre_class = ['highlight']
-  - pre_lang = nil
-  - case document.attr 'source-highlighter'
-  - when 'coderay'
-    - pre_class.unshift 'CodeRay'
-    - code_class = nil
-  - when 'pygments'
-    - pre_class.unshift 'pygments'
-    - code_class = nil
-  - when 'highlightjs', 'highlight.js'
-    - pre_class.unshift 'highlightjs'
-  - when 'prettify'
-    - pre_class.unshift 'prettyprint'
-    - pre_class << 'linenums' if attr? :linenums
-  - when 'html-pipeline'
-    - pre_lang = code_lang
-    - code_class = code_lang = pre_class = nil
-    - nowrap = false
-  - pre_class << 'nowrap' if nowrap
-  %code.block{:"aria-label" => (title? ? title : nil)}
-    - if title?
-      %span.title=title
-    %pre{:class=>pre_class, :lang=>pre_lang}
-      %code{:class=>code_class, 'data-lang'=>code_lang}=content
-- else
-  %code.block{:"aria-label" => (title? ? title : nil)}
-    - if title?
-      %span.title=title
-    %pre{:class=>('nowrap' if nowrap)}=content
+%code{:"aria-label" => (title if title?)}=content
diff --git a/.config/mutt/asciidoc-template/block_open.html.haml b/.config/mutt/asciidoc-template/block_open.html.haml
@@ -1,6 +1,5 @@
 - if @style == 'abstract'
-  %blockquote
-    - if title?
-      %h1=title
-    =content
+  %blockquote=content
+- else
+  =content
 
diff --git a/.config/mutt/asciidoc-template/block_paragraph.html.haml b/.config/mutt/asciidoc-template/block_paragraph.html.haml
@@ -1,2 +1 @@
-%p 
-  =content
+%p=content
diff --git a/.config/mutt/asciidoc-template/block_quote.html.haml b/.config/mutt/asciidoc-template/block_quote.html.haml
@@ -3,6 +3,7 @@
   - if (attr? :attribution) or (attr? :citetitle)
     %footer
       - if attr? :attribution
-        &#8212; #{attr :attribution}
+        = preceed "— " do
+          =(attr :attribution)
       - if attr? :citetitle
-        %cite=attr :citetitle
+        %cite=(attr :citetitle)
diff --git a/.config/mutt/asciidoc-template/block_table.html.haml b/.config/mutt/asciidoc-template/block_table.html.haml
@@ -26,17 +26,15 @@
               - rs = cell.rowspan
               - haml_tag tag, :<, :colspan => cs, :rowspan => rs, :background => bg do
                 - if tblsec == :head
-                  .cell=cell_content
+                  =cell_content
                 - else
                   - case cell.style
                   - when :asciidoc
-                    .cell=cell_content
+                    =cell_content
                   - when :verse
-                    .cell~cell_content
+                    ~cell_content
                   - when :literal
-                    .cell
-                      %pre=cell_content
+                    %pre=cell_content
                   - else
-                    .cell
-                      - cell_content.each do |text|
-                        %p<=text
+                    - cell_content.each do |text|
+                      %p<=text
diff --git a/.config/mutt/asciidoc-template/block_ulist.html.haml b/.config/mutt/asciidoc-template/block_ulist.html.haml
@@ -1,4 +1,4 @@
-%ul{:start => (attr :start), :type => list_marker_keyword}
+%ul
   - items.each do |item|
     %li
       =item.text
diff --git a/.config/mutt/asciidoc-template/document.html.haml b/.config/mutt/asciidoc-template/document.html.haml
@@ -18,6 +18,7 @@
 
     - unless (docinfo_content = docinfo).empty?
       =docinfo_content
-  %body{:id => @id }
+  %body
+    %h1=title
     =content
 
diff --git a/.config/mutt/asciidoc-template/inline_anchor.html.haml b/.config/mutt/asciidoc-template/inline_anchor.html.haml
@@ -7,8 +7,10 @@
 - when :ref
   %a(id=@target){:target => (attr :window)}
 - when :bibref
-  %a(id=@target){:target => (attr :window)}>
-  =%([#{@target}])
+  %a(id=@target){:target => (attr :window)}
+    %sup
+      = surround "[", "]" do
+        =@target
 - else
-  %a(href=@target){:id=>@id, :target=>(attr :window), 
-    :title=>(attr :title)}=@text
+  %a(href=@target){:id=>@id, :target=>(attr :window), :title=>(attr :title)}
+    =@text
diff --git a/.config/mutt/asciidoc-template/inline_menu.html.haml b/.config/mutt/asciidoc-template/inline_menu.html.haml
@@ -1,15 +0,0 @@
-- menu = attr 'menu'
-- menuitem = attr 'menuitem'
-- if !(submenus = attr 'submenus').empty?
-  %span.menuseq
-    %span.menu>=menu
-    ='&#160;&#9656; '
-    =submenus.map {|submenu| %(<span class="submenu">#{submenu}</span>&#160;&#9656; ) }.join
-    %span.menuitem>=menuitem
-- elsif !menuitem.nil?
-  %span.menuseq
-    %span.menu>=menu
-    ='&#160;&#9656; '
-    %span.menuitem>=menuitem
-- else
-  %span.menu=menu