jgm / pandoc

Universal markup converter
https://pandoc.org
Other
33.39k stars 3.31k forks source link

Export to Netscape Bookmark format #8247

Open morgandavidson opened 1 year ago

morgandavidson commented 1 year ago

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):

* Data
** Finance
*** Crypto
- [[https://no.tradingeconomics.com/xmreur:cur][XMREUR]]
* Webapps
** Code
*** Bash
- [[https://www.shellcheck.net/][ShellCheck]]
  finds bugs in your shell scripts.
*** JSON
- [[https://stedolan.github.io/jq/manual/][jq Manual]]
  jq is a lightweight and flexible command-line JSON processor.
- [[https://jqplay.org/][jq online GUI]]
- [[https://www.json.org/json-en.html][JSON Intro]]

** Diagrams
- [[https://asciiflow.com/#/][asciiflow]]
- [[https://app.diagrams.net/][draw.io]]

** E-mail
- [[https://temp-mail.org][temp email]] 

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.

jgm commented 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

morgandavidson commented 1 year ago

At first, I thought of an Elisp tweak for emacs. Indeed a Lua script might be well adapted for the use case.

morgandavidson commented 1 year ago

Here is how Org-Mode managed bookmarks could be exported to Netscape Bookmarks :

<!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>