Your rookeries’ contents are always also available in Typst through the #ideas() function. This function returns all of your ideas as a data structure that you may then use to customize your rookery or power downstream applications. ideas has to be called inside #context:
#import "@rookery/core:0.1.0": ideas, note-href, note-path, idea-body
#context {
for e in ideas(tags: "concept") [- #link(e.href, e.text)]
note-href("as-databases")
// -> "../ideas/as-databases.html", relative to invocation
note-path("as-databases")
// -> "ideas/as-databases.html", path from site root
idea-body(
// idea ID
"as-databases",
// limit number of lines
limit: 15,
// how many layers of children ideas
depth: 2,
)
// -> full content (without chrome)
}The ideas function returns an array of dictionaries that each have the following structure:
| Field | What it holds |
|---|---|
id | The full ID, prefix included—"idea:etal". |
name | The same ID with the prefix stripped—"etal", the form you write in #window("etal"). |
title, text | The title as content, or none; and that title flattened to a plain string, "" where there is none. Take text for matching and sorting, title for rendering. |
tags | The idea’s tags, in the order you gave them—which is not alphabetical, and not quite the order they were written, since #note and #todo prepend their own. |
body | The idea’s body flattened to a plain string, "" where there is none. Matchable and excerptable, not renderable—for rendering, see #idea-body below. A nested idea’s text is excluded, since it registers separately and owns its own. |
href, page | A link to the idea’s minted page: href measured from the page you are calling on, page from the site root. Both none where nothing mints pages. |
minted, updated | The idea’s dates, or none. |