Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding how headings are exported #725

Open
andreyorst opened this issue Sep 1, 2023 · 0 comments
Open

Overriding how headings are exported #725

andreyorst opened this issue Sep 1, 2023 · 0 comments

Comments

@andreyorst
Copy link
Contributor

Hi! I would like to ask if it is possible to add an extension point to the org-hugo-heading function in order to tweak how certain headings are exported. Right now I want to make a page on my blog that lists some collapsable items, created with the <details> tag, but I want to keep the outline capabilities in the Org file itself too. So, after exporting, the end result on the page should be something similar to what Emacs does in the buffer, allowing me to fold headings.

In other words, in my specific case, I was trying to transform this:

* heading
text
* heading 2
text 2

Into this:

<details>
<summary><h1>heading</h1></summary>
text
</details>

<details>
<summary><h1>heading 2</h1></summary>
text 2
</details>

But I can imagine more cases when someone wants to transform headings and their contents into something else.

I've already achieved this by advising the function and checking for a custom property so here I'm just asking if you think this makes sense to add this kind of feature to the package itself.

There are already some ways to configure how headings are exported, for example, you can set the N in #+options: H:N to some number and after this depth, the headings are transformed into list items. So maybe there's space for a more generic mechanism.

If you're OK with this, I can look into implementing it, if not define-advice it is :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant