Projects About AlBasmala
build status

Permalinks ---Org's own =<>=, made visible---

Article image
  

⭐ The code lives at github.com/alhassy/org-special-block-extras —star it, or discuss it there!

Sometimes we want to point explicitly at a particular location in an article, such as within a #+begin_details block. Org already has two kinds of target for this; we merely make the first one visible.

With org-special-block-extras-mode on, in HTML:

Two targets whose names differ only in whitespace, such as <<a b>> and <<a-b>>, share an id; we name them apart.

Going forward, we could give every heading such a permalink too, producing clickable org-headings similar to Github's —the necessary ingredients are likely here.


﴾What You Write﴿
<<example-location>> (Click the icon and see the URL has changed!)
﴾What You Get﴿

(Click the icon and see the URL has changed!)

Tests
(deftest "It works as expected: We have an anchor with the given ID, and the default SVG chain icon."
  [target]
  (⇝ (⟰ "<<example-location>> (Click the icon and see the URL has changed!)")
     "<a class=\"anchor\" id=\"example-location\" href=\"#example-location\" aria-label=\"Permalink to example-location\"><svg"
     (* anything)
     "</svg></a> (Click the icon and see the URL has changed!)"
     (* anything)))

Generated by Emacs and Org-mode (•̀ᴗ•́)و
Creative Commons License
Life & Computing Science by Musa Al-hassy is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License