1 line
3.4 KiB
Plaintext
1 line
3.4 KiB
Plaintext
<!-- SC_OFF --><div class="md"><p>Hi all,</p> <h1>Problem Description</h1> <p>I'm trying to have the same <code>.org</code> file exported to LaTeX and ox-hugo. I use the template <a href="https://www.docsy.dev/">docsy</a> template to export to which uses an <a href="https://www.docsy.dev/docs/adding-content/shortcodes/#alert">alert shortcode</a> to render an alert/info area.</p> <p>In LaTeX I use <a href="https://packages.oth-regensburg.de/ctan/graphics/awesomebox/awesomebox.pdf">awesomebox</a> to render a similar block.</p> <p>The LaTeX output works perfectly when I am using </p> <p><code> #+begin_noteblock This is a noteblock info environment from the awesomebox LaTeX package. #+end_noteblock </code></p> <p>Now I want that noteblock to render into the following when using the <code>ox-hugo</code> export:</p> <p><code> {{% alert title="Warning" color="warning" %}} This is a warning. {{% /alert %}} </code></p> <p>I found I should be able to use <code>org-special-block-extras</code> to do this conversion, but I seem to be getting it wrong, as on export no conversion happens. As I though there is maybe something wrong with the condition, I added the caution block as well, but that also does not work.</p> <p>I deleted my <code>~/.emacs.d</code> and had everything set up from scratch again, in order to be "fresh".</p> <p>Can someone tell me what I am doing wrong here and how I can achieve the desired result?</p> <h1>Configuration</h1> <p>The configuration I am using is:</p> <p><code> (use-package org-special-block-extras :ensure t :hook (org-mode . org-special-block-extras-mode) ;; All relevant Lisp functions are prefixed ‘o-’; e.g., `o-docs-insert'. :config (org-special-block-extras--defblock noteblock (title "Details") (title-color "Green") "Define noteblock export for docsy ox hugo" (cond ((eq backend 'ox-hugo) (format "{{%% alert title=\"%s\" color=\"%s\" %%}}\n%s\n{{%% /alert %%}}" title title-color contents)) )) (org-special-block-extras--defblock cautionblock nil nil "Awesomebox caution" (format "{{%% alert title=\"caution\" color=\"info\" %%}}%s{{%% /alert %%}}" contents) ) ) </code></p> <h1>Errors</h1> <p>I get these compile errors:</p> <p>``` Compiling file /Users/j/.emacs.d/elpa/org-special-block-extras-20210909.2032/org-special-block-extras.el at Wed Dec 8 23:38:13 2021 Entering directory ‘/Users/j/.emacs.d/elpa/org-special-block-extras-20210909.2032/’</p> <p>In org-special-block-extras-mode: org-special-block-extras.el:133:17:Warning: reference to free variable ‘o--docs-from-libraries’ org-special-block-extras.el:194:21:Warning: assignment to free variable ‘o--docs-actually-used’ org-special-block-extras.el:195:21:Warning: assignment to free variable ‘o--docs’ org-special-block-extras.el:602:1:Warning: Unused lexical variable ‘blk-column’ org-special-block-extras.el:681:1:Error: Symbol’s value as variable is void: o--supported-blocks ```</p> </div><!-- SC_ON -->   submitted by   <a href="https://www.reddit.com/user/authsec"> /u/authsec </a> <br/> <span><a href="https://www.reddit.com/r/emacs/comments/rc32ei/orgmodeoxhugo_custom_begin_noteblock/">[link]</a></span>   <span><a href="https://www.reddit.com/r/emacs/comments/rc32ei/orgmodeoxhugo_custom_begin_noteblock/">[comments]</a></span> |