Open morgandavidson opened 1 year ago
This seems a bit too specialized to me. The perfect use case for a custom Lua writer. https://pandoc.org/custom-writers.html
At first, I thought of an Elisp tweak for emacs. Indeed a Lua script might be well adapted for the use case.
Here is how Org-Mode managed bookmarks could be exported to Netscape Bookmarks
:
HTML
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!--This is an automatically generated file.
It will be read and overwritten.
Do Not Edit! -->
<Title>Bookmarks</Title>
<H1>Bookmarks</H1>
The rest of the exported HTML should be as follow, where {item} may be either a folder or a bookmark:
<DL>
{item}
{item}
{item}
.
.
.
</DL>
If {item}
refers to a folder, it is:
<DT><H3 FOLDED ADD_DATE="{date}">{title}</H3>
<DL><p>
{item}
{item}
{item}
.
.
.
</DL><p>
Where {date}
is a decimal integer that represents the number of seconds elapsed since midnight January 1, 1970, e.g. 1661350152
. And {title}
is the name of the folder corresponding to an orgdown headline.
If {item} refers to a bookmark, it is:
<DT><A HREF="{Bookmark URL}" ADD_DATE="{date}" LAST_MODIFIED="1661350203">{Bookmark Name}</A>
Corresponding to Orgdown [[{Bookmark URL}][{Bookmark Name}]]
Netscape Bookmark format is used by main browsers (Chrome, MS browsers, Firefox) to export and import browsers bookmarks to HTML.
I find it much easier to manage and centralize browser bookmarks with Org-Mode.
Here is an example of an org file storing some bookmarks (note that in browser bookmarks each heading would correspond to a folder and each link to a bookmark):
Unfortunately, I didn't find any tool allowing exporting bookmarks from a markup format to Netscape Bookmark format.
I thought that this feature might be in the scope of Pandoc.