alhassy / org-special-block-extras

A number of new custom blocks and link types for Emacs' Org-mode ^_^

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

export fails on org-9.4?

psudopixel opened this issue · comments

kbd:C-x exports fine, but badges cause the following stack trace.

badge:x|Y is the only line in this org file.

string-prefix-p: Wrong type argument: stringp, (:export-options nil :back-end #s(org-export-backend html nil ((bold . org-html-bold) (center-block . org-html-center-block) (clock . org-html-clock) (code . org-html-code) (drawer . org-html-drawer) (dynamic-block . org-html-dynamic-block) (entity . org-html-entity) (example-block . org-html-example-block) (export-block . org-html-export-block) (export-snippet . org-html-export-snippet) ...) ((:html-doctype "HTML_DOCTYPE" nil org-html-doctype) (:html-container "HTML_CONTAINER" nil org-html-container-element) (:description "DESCRIPTION" nil nil newline) (:keywords "KEYWORDS" nil nil space) (:html-html5-fancy nil "html5-fancy" org-html-html5-fancy) (:html-link-use-abs-url nil "html-link-use-abs-url" org-html-link-use-abs-url) (:html-link-home "HTML_LINK_HOME" nil org-html-link-home) (:html-link-up "HTML_LINK_UP" nil org-html-link-up) (:html-mathjax "HTML_MATHJAX" nil "" space) (:html-equation-reference-format "HTML_EQUATION_REFERENCE_FORMAT" nil org-html-equation-reference-format t) ...) ((:filter-options . org-html-infojs-install-script) (:filter-parse-tree . org-html-image-link-filter) (:filter-final-output . org-html-final-function)) nil (104 "Export to HTML" ((72 "As HTML buffer" org-html-export-as-html) (104 "As HTML file" org-html-export-to-html) (111 "As HTML file and open" (lambda (a s v b) (if a (org-html-export-to-html t s v b) (org-open-file (org-html-export-to-html nil s v b)))))))) :translate-alist ((bold . org-html-bold) (center-block . org-html-center-block) (clock . org-html-clock) (code . org-html-code) (drawer . org-html-drawer) (dynamic-block . org-html-dynamic-block) (entity . org-html-entity) (example-block . org-html-example-block) (export-block . org-html-export-block) (export-snippet . org-html-export-snippet) ...) :exported-data #s(hash-table size 4001 test eq rehash-size 1.5 rehash-threshold 0.8125 data ( ...)) :input-buffer "x.org" ...)

I recently also upgraded to Org 9.4 and have been using org-special-block-extras, including the block types and kbd, but apparently I have not been using the badge link type.

The documentation says badge:key|value should work fine as a minimal template, but that seems to only be true for Org 9.3.

It seems there may have been a change to Org 9.4 that broke whatever it was I was doing.

I cannot look into this as soon as I'd like; however you could make an Org macro for badges that produces the desired HTML. Actually, here I'll make it for you ---I've tested it and it works well :-)

# $1 key
# $2 value
# $3 color (possibly with logo: green?logo=...
# $4 url 
#+macro: badge @@html:<a href="$4"><img src="https://img.shields.io/badge/$1-$2-$3"></a>@@

# Example uses

{{{badge(Musa's, Blog, cyan?logo=gnu, http://alhassy.github.io/)}}}

{{{badge(Minimal Macro Example, Needs a Colour!, orange)}}}

Fixed by commit fc84dd2