Emanote supports exporting your notebook content in different formats:
JSON export
The metadata of all content (Markdown ✍️ and Org Mode ✍️), along with their link relationships, can be retrieved as JSON
using one of the following means:
-
emanote export metadata
: a CLI command that dumps the JSON export to stdout. - /-/export.json: an URL to retrieve the JSON via live server or from the statically generated site.
Content export
All notes from your notebook can be exported as a single Markdown document optimized for LLMs using:
-
emanote export content
: a CLI command that dumps the content export to stdout. - /-/export.md: an URL to retrieve the content via live server or from the statically generated site.
The content export includes:
- All notes with their original Markdown content
- Metadata headers with source paths, titles, and wikilinks
-
Optional URLs (when
page.siteUrl
is configured in your notebook) - LLM-optimized formatting with clear note delimiters
CLI examples
JSON export examples
Here are some examples of running emanote export metadata
. These commands are run on the ./docs
directory of the Emanote source repository.
git clone https://github.com/srid/emanote.git
cd ./emanote/docs
Get the list of files
$ emanote export metadata | jq .files | jq keys
[
"architecture.md",
"demo.md",
"demo/custom-style.md",
"demo/embed.md",
"demo/file-links.md",
[..]
]
Get a single file
$ emanote export metadata | jq '.files | .[] | select(.filePath=="architecture.md")'
{
"filePath": "architecture.md",
"links": [],
"meta": {
"order": 99,
"page": {
"description": "Emanote is a Haskell program that, at its essense, transforms a bunch of source files (Markdown, static files, etc.) into a target website. It does that in a reactive manner such that as the source files change the resultant website updates in real-time (thanks to Ema's hot-reload via websocket)."
},
"tags": [
"emanote/dev"
]
},
"parentNote": "index.md",
"title": "Architecture",
"url": "architecture"
}
Get all link targets from a note
$ emanote export metadata | jq '.files | .[] | select(.filePath=="start/neuron.md") | .links | .[] | .resolvedRelTarget.contents'
"demo/neuron-layout"
"demo/yaml-config"
"demo/yaml-config"
"demo/file-links"
"demo"
Get the list of tags
$ emanote export metadata | jq '.files | .[] | .meta.tags' | jq -s 'flatten(1)'
[
"emanote/dev",
"emanote/syntax/demo",
"emanote/syntax/demo",
"emanote/syntax/demo",
"emanote/yaml/demo",
"external"
]
Get all files associated with a tag
$ emanote export metadata | jq '.files | .[] | select( any( .meta.tags[]; . == "external" ))'
{
"filePath": "examples.md",
"links": [],
"meta": {
"order": 10,
"page": {
"description": "Here is an assorted collection of websites generated by Emanote, sorted alphabetically:"
},
"tags": [
"external"
]
},
"parentNote": "index.md",
"title": "Examples",
"url": "examples"
}