TR [index]

tr is a site generator based on a collection of scribbles & racket programs.

You can use Ctrl + K (or Meta + K on MacOS) to toggle search bar.

Dependencies of the tool:

Take a look at guide to get start.

Posts [posts]

Break. Update syntax of mention form [mention-0000]

Feature. tr/code [trcode]

@tr/code{...} is a new feature to help users create their own extension for card, for example, you can add math macro

@tr/code{#lang racket
(provide (all-defined-out))

(define RR "\\mathbb{R}")
}

Or use this to fetch cards you want to transclude:

@tr/code{
(require tr/metadata)

(define scrbl-list (find-files (lambda (x) (string-contains? (path->string (file-name-from-path x)) "guide")) "content"))
(define addr-list
  (for/list ([path scrbl-list])
    (compute-addr path)))
}

Then I can use @ol[@(for/list ([addr addr-list]) (li addr))] to list these addresses:

  1. guide-0000
  2. guide-0001
  3. guide-0002
  4. guide-0003
  5. guide-0004
  6. guide-0005
  7. guide-0006
  8. guide-0007
  9. guide-0008

The form can be placed as any top-level form, so you can have

@tr/code{...}
@p{...}
@tr/code{...}

But you must have #lang [language] line in the first @tr/code{...} to decide your language.

Feature. Typst backend [typst]

We support Typst as backend now, below are example:

@typst{
#set page(width: 10cm, height: 4.5cm, margin: 0.5cm)
$
nabla · bold(E) &= frac(rho, epsilon_0) \
nabla · bold(B) &= 0 \
nabla × bold(E) &= -frac(partial bold(B), partial t) \
nabla × bold(B) &= mu_0(bold(J) + epsilon_0 frac(partial bold(E), partial t))
$
}
figure typ1822
@typst|{
#import "@preview/fletcher:0.5.8" as fletcher: diagram, node, edge
#set page(width: 8cm, height: 4cm, margin: 0.3cm)

#diagram(cell-size: 15mm, $
        G edge(f, ->) edge("d", pi, ->>) & im(f) \
        G slash ker(f) edge("ur", tilde(f), "hook-->")
$)
}|
figure typ1823

Tool. bib2tr [bib2tr]

Tool. html2scrbl [html2scrbl]

Break. texfig now must manually assigns LaTeX header part [texfig-0000]

Form @texfig{...} at before implicitly do

\usepackage{quiver}
\usepackage{tikz}
\usetikzlibrary{spath3, intersections, backgrounds}

for users, now they are removed. Hence you must write it out explicit

@texfig[#:header @"
\\usepackage{tikz}
\\usetikzlibrary{spath3, intersections, backgrounds}
"]{
...
}

The output Tex file you will get is

\documentclass[crop,dvisvgm]{standalone}
\usepackage{tikz}
\usetikzlibrary{spath3, intersections, backgrounds}
\begin{document}
...
\end{document}

Policy of breaking changes [policy-0000]

Since TR is a finished software (https://josem.co/the-beauty-of-finished-software/), every non-customize behaviour and already worked functions will not be removed, if you found your old cards stop working, reports to https://github.com/dannypsnl/tr/issues. I can't say there won't have any exceptions, but most problems should be counted as TR's bugs, and hence should be fixed.

Due to early experimental code, tikzcd and texfig is unstable.

The styling isn't belongs to above promise, I can only say I would avoid to touch them as possible. For example, recently I want to minimize table of content on mobile to improve UX, but except that, I will not change code of assets.

If a necessary breaking change is made, I will create a new post here that explain how to fix it.