diff --git a/ha-org-pikchr-01.svg b/ha-org-pikchr-01.svg new file mode 100644 index 0000000..1ab52ea --- /dev/null +++ b/ha-org-pikchr-01.svg @@ -0,0 +1,9 @@ + + + +Hello, +World! + + + + diff --git a/ha-org-pikchr-02.svg b/ha-org-pikchr-02.svg new file mode 100644 index 0000000..510bfc4 --- /dev/null +++ b/ha-org-pikchr-02.svg @@ -0,0 +1,9 @@ + + +head + +tail + +something + + diff --git a/ha-programming.org b/ha-programming.org index c49d403..d6175f0 100644 --- a/ha-programming.org +++ b/ha-programming.org @@ -1095,7 +1095,8 @@ Also, I like Markdown is look like a word processor, similarly to my org files: (use-package markdown-mode :straight (:host github :repo "jrblevin/markdown-mode") :mode ((rx ".md" string-end) . gfm-mode) - :init (setq markdown-command "multimarkdown" + :init (setq markdown-command (expand-file-name "markdown" "~/bin") + markdown-open-command (expand-file-name "markdown-open" "~/bin") markdown-header-scaling t) :general (:states 'normal :no-autoload t :keymaps 'markdown-mode-map @@ -1125,6 +1126,25 @@ With the =markdown-header-scaling= set, we no longer need to color the headers i :foreground default-color)))) #+end_src +Both the =markdown-command= and the =markdown-open-command= variables are called to render (and preview) a Markdown file (~C-c C-c o~), and calls the following scripts (which in turn, call =pandoc= as I depend on this for other org-related features): + +#+begin_src sh :tangle ~/bin/markdown :shebang "#!/usr/bin/env bash" :tangle-mode u+x + pandoc --to=html --from=gfm $* +#+end_src + +#+begin_src sh :tangle ~/bin/markdown-open :shebang "#!/usr/bin/env bash" :tangle-mode u+x + OUTPUT_FILE=$(mktemp 'emacs-view-XXXXXXX.html') + pandoc --to=html --from=gfm --output=$OUTPUT_FILE $* + + # Are we on a MacOS Laptop: + if [ -d "/Library" ] + then + open $OUTPUT_FILE + else + firefox -new-tab $OUTPUT_FILE + fi +#+end_src + Using [[https://polymode.github.io/][polymode]], let’s add syntax coloring to Markdown code blocks similar to what we do with Org: #+begin_src emacs-lisp