Sane HTML exports for org-mode https://words.plum.moe/ox-plumhtml.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
not manx ba1a20ac3b
Update README
4 years ago
LICENSE License 5 years ago
README.org Update README 4 years ago
ox-plumhtml-tests.el Add tests for headers and links 4 years ago
ox-plumhtml.el Use options-alist correctly 4 years ago

README.org

PlumHTML

org-export backend for sane HTML. Basically some changes and extensions to ox-slimhtml.

Used to publish words I write.

Installation

You want to clone the repo, cd to it then do M-x package-install-file on ox-plumhtml.el

Header IDs

In org-mode you can do something like

#+plumhtml_header_ids:
* Header 1
.....
some content...
.....
* Header 2
[[Header 1][Link to header 1]]

And the link will jump back to Header 1 when you click it.

This is implemented in ox-plumhtml conditionally by setting the variable ox-plumhtml-export-header-ids, or putting #+plumhtml_header_ids: t in your org file.

Exported contents look like this when set to nil:

<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body><h1>Header 1</h1><p>.....
some content...
.....
</p>
<h1>Header 2</h1><p><a href="Header 1">Link to header 1</a>
</p>
</div></body>
</html>

And this when non-nil:

<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body><h1 id="orgffb8f9b">Header 1</h1><p>.....
some content...
.....
</p>
<h1 id="org89773e7">Header 2</h1><p><a href="#orgffb8f9b">Link to header 1</a>
</p>
</div></body>
</html>

It adds some noise to the outputted file but it's worth it IMO.

Functions

ox-plumhtml-export-as-html

Makes a temporary buffer with the exported HTML.

ox-plumhtml-export-to-html

Like ox-plumhtml-export-as-html but dumps the exported HTML to a file like example.org -> example.html

ox-plumhtml-publish-to-html

Same as ox-plumhtml-export-as-html but for org-publish

Tests

I stole them from ox-slimhtml lole

emacs -batch \
      -l ert \
      -l ox-plumhtml-tests.el \
      -f ert-run-tests-batch-and-exit