Release. Forester 3.1 [00HY]
- March 9, 2024
- Jon Sterling, with contributions from Kento Okura, Owen Lynch
To use this release, you will need to upgrade your theme and you may also need to edit your forest itself (please write to the mailing list if you encounter difficulties). Remember that this includes not only the XSLT stylesheet, but also the CSS stylesheet and the JavaScripts.
The base theme is now versioned: if you are using Forester 3.1, you can confidently use the 3.1.0 tag. The head of the main branch of the theme may at times include changes that are compatible with only the main branch of Forester itself.
Feature Designated parents [00O3]
- March 9, 2024
- February 8, 2024
- Jon Sterling
In keeping with the philosophy of evergreen notes, hierarchical structure in Forester has always been introduced by transclusion of independent trees; in this model, a tree has no canonical parent because it may be contextualised in many distinct hierarchical narratives. Experience using Forester suggests that this is the right idea the vast majority of the time, but use-cases have emerged that challenge these assumptions: there do indeed arise natural subtrees that are exceedingly awkward to “decontextualise”.
For example, the features described in a changelog (such as the present one) are awkward to decontextualise because they refer to knowledge that is temporary in its applicability. Likewise, the subtrees of one’s daily notes or journal are likely to be fleeting in nature and may have little insight that can be decontextualised — and in spite of this, these notes remain important for restoring mental context on long-running projects, etc.
For these reasons, I have (reluctantly) added a new frontmatter directive \parent{xxx-NNNN}, which designates the tree at address xxx-NNNN as “the” context-providing parent of the current tree. This feature is experimental and under-theorised; it should be used sparingly.
When a given tree appears transcluded within its “designated” parent, it will be shown with the title that has been specified; however, when the tree appears outside of this context, its title will appear with the parent’s title prepended to it: “parent › child”.
Feature Inline subtrees [00O4]
- March 9, 2024
- February 8, 2024
- Jon Sterling
Previously, there was a one-to-one mapping between trees and files. After discussion on the mailing list with Kristopher Brown, I have added support for defining new subtrees inline to an existing tree. The current behavior is that an inline subtree has its designated parent automatically assigned; author and date metadata is inherited (this may change in the future).
To emit (and transclude) a subtree at address xxx-NNNN, you can write the following:
\subtree[xxx-NNNN]{
\title{My title}
\p{my body}
}It is also possible to have an anonymous inline subtree, one that has no address of its own. In this case, write:
\subtree{
\title{My title}
\p{my body}
}An anonymous inline subtree will, naturally, not have its own page emitted and cannot be linked to. In the graph analysis (for computing backlinks, etc.), an anonymous inline subtree will be identified with its parent.
Inline subtrees should not be overrused; but they may make the process of daily journalling and other activities more lightweight.
One consequence of breaking the one-to-one relationship between trees and files is that commands like forester new need to actually fully evaluate the forest, whereas in the past it was possible to merely scan the file system. This is a trade-off: if your forest contains fatal errors, you cannot use forester new or related querying commands. You should never leave your forest with fatal errors long enough to notice this.
This feature is experimental and its behaviour may change. Use it at your own risk.
Feature cleveref-style referencing [00HZ]
- January 12, 2024
- Jon Sterling
You can now write \ref{xxx-NNNN} to produce a link to the tree at address xxx-NNNN labeled by its taxon. After the taxon, the textual format and destination of the link depends on whether xxx-NNNN lies in the present context. If the linked tree is present, then link will refer to the first transclusion of the tree into the present context; otherwise, the link will refer to the tree’s stable address. For example:
- A reference to this very tree: Feature [00HZ].
- A reference to a parent of this tree: Release [00HY].
- A reference to a cousin of this tree: Feature [00EY].
The behavior of references within one tree naturally depends on the transclusion context in which you are viewing that tree. It is instructive to examine the examples above by viewing this tree from its parent or on its own page.
Feature New forester query command [00O5]
- March 9, 2024
- Jon Sterling, with contributions from Kento Okura
Kento Okura has implemented a new forester query command that may be useful for creating external editor tooling; currently it is possible to query for lists of all prefixes (the xxx in xxx-NNNN), tags, and taxa. Please run forester query --help for more information.
Feature Random vs. sequential generation of addresses [00O6]
- March 9, 2024
- Jon Sterling, with contributions from Owen Lynch
By default, Forester generates tree addresses sequentially within a given prefix; Owen Lynch has implemented forester new --random, which instead generates random tree identifiers. Although this option is not recommended for most users, it can be used to mitigate the problem of multiple collaborators creating trees within the same prefix. Please run forester new --help for more information.
Feature Manual numbering for digital editions [00Q6]
- March 9, 2024
- Jon Sterling
Numbering of trees in Forester is by default relative and determined by position in the current view. When creating translations or digital editions, the numbering from the source material is what is important. For this reason, I have added a new frontmatter directive to impose a manual numbering on a given tree.
\taxon{Chapter}
\number{foo}This numbering will be used in the table of contents, headings, and by Feature [00HZ].
Change Improvements to verbatim lexer [00OH]
- March 9, 2024
- Jon Sterling
Forester includes a special lexing mode for quoting source code, delimited by \startverb and \stopverb. This mode was never implemented properly and so it did not work well in practice; for example, previously the line comment lexer could be activated via % from within vebatim mode, which made it very difficult to quote code that has comments. The lexer has been revamped and the behavior of verbatim mode is a bit different from before.
Between the delimiters (\startverb,\stopverb), text now is taken precisely as-written, except that newlines are stripped from the beginning and the end of the quoted text. Previously, the strange behavior of comments noted above could be used to manually avoid an initial line break from appearing in the quoted text. So in a prior version of Forester, you may have written something like this:
\startverb% my verbatim text \stopverb
Now, you should instead write:
\startverb my verbatim text \stopverb
Change Removal of \texpackage and changes to \tex [00LR]
- January 25, 2024
- Jon Sterling
In Forester 2.1, the \texpackage frontmatter command was added in order to accumulate a list of packages that are then used automatically when rendering \tex{code...}. From Forester 3.1, this feature is removed and to embed \LaTeX code, you must explicitly specify the preamble as follows:
\tex{
\usepackage{mypackage1}
\usepackage{mypackage2}
}{
my code goes here
}Of course, within a single project (or even forest), you may have a relatively stable set of \LaTeX packages that you need. In this case, it is recommended to wrap \tex in your own macro:
\def\my-tex[body]{
\tex{
\usepackage{mypackage1}
\usepackage{mypackage2}
}{\body}
}An even more sophisticated approach might use fluid bindings to allow local customisation of packages in use:
\alloc\my-tex-preamble
\def\my-tex[body]{
\scope{
\put?\my-tex-preamble{}
\tex{\get\my-tex-preamble}{\body}
}
}Change Removal of undocumented \LaTeX output [00O2]
- March 9, 2024
- February 8, 2024
- Jon Sterling
Previously, Forester would emit .tex files for each of your trees in the latex directory. This feature has been removed, as \LaTeX can be generated more reliably using XSLT. Please see the forester-to-latex repository for an example stylesheet.
Change Breaking changes to the XML format [00LS]
- January 25, 2024
- Jon Sterling
Forester 3.1 makes some breaking changes to the XML format; if you are using the default theme, just update it to the latest version to migrate your forest. The main change is that “trails” for subtrees (like “1.4.2”) are no longer computed ahead of time and stored in XML, but are instead computed on the fly in the XSLT stylesheet using <xsl:number>.
A further change is that embedded \LaTeX is no longer emitted using the <img> element: instead, there is a new <embedded-tex> element with an attribute @hash containing the name (without extension) of the appropriate SVG file, and with children elements <embedded-tex-preamble> and <embedded-tex-body>. These are meant to facilitate generation of \LaTeX documents from Forester’s XML output in combination with the filecontents environment.