Release. Forester 3.0 [00CW]
- November 3, 2023
- Jon Sterling, with contributions from Kento Okura, Lîm Tsú-thuàn, Owen Lynch, Kuen-Bang Hou (Favonia)
This is a major breaking release; some surgery may be required on existing forests. Thanks to Favonia, Kento Okura, Lîm Tsú-thuàn, and Owen Lynch for their contributions to this release. Thanks also to Adrien Guatto for bug reports.
Feature Proper diagnostics with source locations [00CX]
- November 3, 2023
- Jon Sterling
Forester 3.0 adds proper diagnostics and error messages, via the excellent asai library maintained by Favonia. When something goes wrong in your forest, the terminal output should expain what happened while displaying the precise location in your source file.
Feature Experimental support for objects [00EY]
- November 19, 2023
- Jon Sterling
To facilitate the development of extensible macro libraries for diagramming and other tasks, Forester 3.0 introduces experimental support for objects — which should be thought of as combination of records/structs, closures, and general recursion. An object is created like so:
\def\my-object{
\object[self]{
[method1]{
the implementation of this method
}
[method2]{
the implementation of another method
\self#method1
}
}
}The variable self is explicitly bound, and can be bound to any name you like. Methods currently are not allowed to take any arguments, but this may change in the future. A primitive form of inheritance is supported, using \patch:
\patch{\my-object}[self]{
[method1]{
\self/super#method1
some further code
}
}The support for objects in Forester 3.0 is extremely experimental and preliminary: users are discouraged from relying on it.
Feature Improvements to date handling [00F0]
- November 20, 2023
- Jon Sterling
Forester 3.0 improves support for journaling with date-specific trees. When a tree is dated YYYY-MM-DD and there exists a tree at address YYYY-MM-DD, the date field will be hyperlinked to the latter. This involves changes to both the executable and the XSL stylesheet of the base theme. The purpose of this change is to better facilitate daily notes / journaling.
Additionally, Forester’s data model now allows multiple dates to be assigned to a single tree simultaneously.
Feature Nix support [00FI]
- November 22, 2023
- Kento Okura
Forester 3.0 comes with a nix flake
for easy integration with nix-based systems. Users of nix can try
forester without installing the ocaml toolchain by running
nix run sourcehut:~jonsterling/ocaml-forester.
To create a development shell with forester and LaTeX dependencies,
create a file named flake.nix with the following content:
{
inputs = {
forester = {
url = "sourcehut:~jonsterling/ocaml-forester";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{ self
, flake-utils
, nixpkgs
, forester
}:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system; };
legacyPackages = import forester.legacyPackages.${system};
in
{
devShell =
pkgs.mkShell {
buildInputs = with pkgs; [
forester.packages.${system}.default
texlive.combined.scheme-full
fswatch
];
};
});
}and run nix develop.
The default template now ships with a flake and an envrc. If you created your forest using this template and would like to use direnv, simply copy flake.nix and .envrc to your forest base directory.
Feature Lightweight templating in forester new [00G7]
- December 2, 2023
- Jon Sterling, Lîm Tsú-thuàn
Forester 3.0 adds a new --template option to the forester new command. Running forester new --template xxx-0001 will create a new tree with the contents of the existing tree xxx-0001.
Feature Support for randomised tree identifiers in forester new [00GG]
- December 13, 2023
- Jon Sterling, Owen Lynch
The forester new has a new --random flag; when activated, the new tree will be allocated with a randomised unused tree identifier rather than the usual sequential tree identifier. This can be useful for projects that have multiple collaborators, although in this case, users are generally advised to claim their own namespaces.
Feature Custom static assets directories [00GL]
- December 15, 2023
- Jon Sterling
A new --assets-dirs option has been added to the forester build command, which can be used to supply multiple directories containing static assets that should be copied into the forest. By default, the option is set to assets.
Breaking changes [00CY]
- November 3, 2023
- Jon Sterling
Forester 3.0 introduces a number of breaking changes to the source language in order to facilitate maintainability, diagnostic support, and extensibility of both the Forester tool and your individual forests.
Change Fall-through of undefined identifiers [00CZ]
- November 3, 2023
- Jon Sterling
The fall-through for undefined identifiers in XML mode is removed in Forester 3.0: previously when an identifier \foo was undefined, it was possible to write \foo[attr]{value}{body} and have this be rendered in XML to <foo attr="value">body</foo>.
This behavior has been removed, but you can nonetheless write \xml{foo}[attr]{value}{body} to achieve the same. For content that is being rendered by either LaTeX or KaTeX, simple fallthrough (naturally without attributes or arguments) is supported; therefore #{\alpha} will render to \alpha .
Change Primitive formatting commands [00D0]
- November 3, 2023
- Jon Sterling
As a consequence of the changed fallthrough behavior, several new primitives have been added to the source language, including \p, \em, \strong, \ol, \ul, \li, \blockquote, and \pre.
You can add further commands to your primitives using a combination of \def, \iftex, and \xml.