Fork me on GitHub
#emacs
<
2024-04-06
>
teodorlu11:04:33

Good afternoon 🙂 Is it possible to produce an HTML element like

<h1 name="myname">My Name</h1>
from an Org-mode heading like
* My Name
? I’m aware I can use PROPERTIES to set <h1 id="myid">…</h1>, but I haven’t found a way to set <h1 name=".."></h1>.

teodorlu12:04:35

1. I am currently using https://pandoc.org/ to convert from org-mode to html 2. but I’m interested in approaches that work for org-mode’s native HTML export too!

teodorlu12:04:27

It appears that I could model the name property as just … my own custom property in PROPERTIES, but then I have to control the HTML export myself. When I convert

* the first heading
:PROPERTIES:
:ID:       42ab61a2-f0e0-463e-a41b-6e84c42b2fa3
:html-name: the-html-name
:END:

Writing the paragraph.
to pandoc JSON, I get access to the attributes:
[
    [
        "id",
        "42ab61a2-f0e0-463e-a41b-6e84c42b2fa3"
    ],
    [
        "html-name",
        "the-html-name"
    ]
]
so if I use that to generate HTML, I could make it work. (though I’d prefer a “native” solution)

teodorlu07:04:02

on the off-chance that someone wonders why I wanted this, 1. seven days ago there was a bug in pandoc where ID set in PROPERTIES was not respected 2. Since then, this problem has been fixed in pandoc: https://github.com/jgm/pandoc/issues/9639 So I don’t really feel like I need to set name="…" on HTML elements any more, I can use id="…" instead.

Kimo18:04:13

Working on a way to traverse clojure forms with the cursor. I bind these to a rotary encoder so I can move around quickly. Still has a few bugs. Has anyone seen/built something like this?

🎛️ 3
vemv19:04:02

Sounds like a great hack :) Are you familiar with the Paredit family of functions? They provide a variety of ops similar to yours