You can reference an existing idea by creating either a hyperlink or a window. Both kinds of references using the idea’s ID, which is unique in a global namespace.
IDs are normal Typst labels, meaning that compilation will fail if there is a duplicate. To ensure that rookery’s labels don’t easily clash with ones you create yourself, the prefix idea: is prepended to all of your idea IDs. You can customize this prefix when you configure rookery.
Hyperlinks are the lowest-touch way to reference an idea in rookery, and are implemented as regular Typst references. Say you have an idea:
#idea("first-idea", title: [My first idea])The following three bullets all produce the same result: a hyperlink that reads ‘My first idea’ to the idea’s standalone page.
#import "@rheo/rookery:0.1.0": hyperlink
- @idea:first-idea
- @idea:first-idea[My first idea]
- #hyperlink(<first-idea>)[My first idea]Note that you must use the idea: prefix (which you may customize) when you are using references in the Typst namespace. When using the #hyperlink function imported from rookery, you may omit the prefix if you choose.
If you want your references to link to the anchor in the original context in which your idea was hatched, rather than the idea’s standalone page, pass link-to: "anchor" to an individual call:
- #hyperlink(<first-idea>, link-to: "anchor")[My first idea]If you want to redirect all @idea:x-style references to anchors, #hyperlink is also @idea:x’s renderer, installed as a show ref: rule — .with() it instead of the default:
#import "@rheo/rookery:0.1.0": hyperlink
#show ref: hyperlink.with(link-to: "anchor")
- @idea:first-idea // will link to anchor(#set hyperlink.with(...) does not work here — set rules only apply to Typst’s own built-in element functions, not a plain package function like hyperlink.)
Creating a hyperlink to an idea will add it to that idea’s set of backlinks.
Windows can be used to interpolate the entirety of an idea’s content into a different context. They are useful in home pages or other sections that aggregate content.
Fundamentally, windows are a form of augmented hyperlink. They take their name from Nelson’s notion of the transpointing window as, when paired with backlinks, they allow you to see the content either side of the link.
Say you have an idea:
#idea("first-idea", title: [My first idea])You can produce a window on this idea like so:
#import "@rheo/rookery:0.1.0": window
#window(<first-idea>)Note that we do not need the idea: prefix. Like #hyperlink,#window is a function imported from rookery that already knows which namespace to look in.
By default, this window will be unfolded, showing the full content of the idea. If we want it to instead be folded, we can configure it with arguments. We can also pass an array of ideas to window on multiple ideas, and limit
#window(
(<first-idea>, <second-idea>, <third-idea>),
// only show the idea's name and id
folded: true,
// limit the number of ideas shown
limit: 1,
// include the document date
show-date: true,
)Here is an example of a window on the two foundational ideas in rookery, ‘rookery’ and ‘idea’, folded and with date:
Adding a window to an idea will include the window’s context in the idea’s backlinks.
An idea’s footnotes travel with it into a window, numbered from 1 again and listed in the window’s own block — open this one and compare it with the same idea further up the page:
So do its citations: a window carries its own References block, resolving inside the window rather than pointing back at the idea’s own page.
Windows on ideas that are parents in the idea hierarchy can infinitely recurse. By default they do not: a window written inside an idea you are windowing on collapses to its ID, so you always see one idea rather than a tree of them.
Raise depth to unfurl those inner windows, one level per count:
#window(<first-idea>, depth: 1)You can configure window depth rookery-wide like so:
#show: rookery.with(window-depth: 1)
#window(<first-idea>)
#window(<second-idea>, depth: 0)The count is a budget, and it is what makes this safe to ask for. An idea that windows on itself, or two that window on each other, would otherwise unfurl forever; with a budget they bottom out at the ID and stop. Each level also re-renders the idea’s body, so the work multiplies rather than adds — keep the numbers small.
Here is a window on this idea’s own parent, at the default depth. Its own windows show only as ID links: