Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ jobs:
run: |
templatekit check \
--ignore "project_templates/technote_rst/testn-000/technote.toml" \
--ignore "project_templates/technote_md/testn-000/technote.toml"
--ignore "project_templates/technote_md/testn-000/technote.toml" \
--ignore "project_templates/technote_typst/testn-000/technote.toml"

# Test TeX builds only with the latest Python version, since they're
# fairly heavy-weight and the Python version shouldn't matter.
Expand Down
1 change: 1 addition & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SConscript(
"project_templates/nbreport/SConscript",
"project_templates/technote_rst/SConscript",
"project_templates/technote_md/SConscript",
"project_templates/technote_typst/SConscript",
"project_templates/technote_latex/SConscript",
"project_templates/technote_aastex/SConscript",
"project_templates/technote_adasstex/SConscript",
Expand Down
2 changes: 1 addition & 1 deletion project_templates/technote_md/testn-000/technote.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ series_id = "TESTN"
canonical_url = "https://testn-000.lsst.io"
github_url = "https://github.com/lsst/testn-000"
github_default_branch = "main"
date_created = 2026-07-15T19:16:17Z
date_created = 2026-07-18T23:33:23Z
organization.name = "NSF-DOE Vera C. Rubin Observatory"
organization.ror = "https://ror.org/048g3cy84"
license.id = "CC-BY-4.0"
Expand Down
2 changes: 1 addition & 1 deletion project_templates/technote_rst/testn-000/technote.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ series_id = "TESTN"
canonical_url = "https://testn-000.lsst.io"
github_url = "https://github.com/lsst/testn-000"
github_default_branch = "main"
date_created = 2026-07-15T19:16:17Z
date_created = 2026-07-18T23:33:23Z
organization.name = "NSF-DOE Vera C. Rubin Observatory"
organization.ror = "https://ror.org/048g3cy84"
license.id = "CC-BY-4.0"
Expand Down
5 changes: 5 additions & 0 deletions project_templates/technote_typst/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Change log

## 2026-07-18

- Initial proof-of-concept Typst technote template.
44 changes: 44 additions & 0 deletions project_templates/technote_typst/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# technote_typst

**Rubin technical note repository, based on Typst.**

This template generates a new technical note (technote) repository that is written in [Typst](https://typst.app) and published as a PDF, in the style of Rubin's LaTeX technotes.
Rubin technotes, in general, let you document technical designs, proposals, product overviews, results of prototyping experiments, and other types of documentation that doesn't fit in either the change-controlled document tree, or in user documentation.
See [Technotes for stand-alone technical documentation in the Developer Guide](https://developer.lsst.io/project-docs/technotes.html).

The document metadata lives in `technote.toml`, using the same schema as Markdown and reStructuredText technotes, so `documenteer technote add-author` and `sync-authors` manage the author list from the central author database.
The Rubin document template is consumed as the `rubin-technote` Typst package, which the Makefile fetches from [lsst-texmf](https://github.com/lsst/lsst-texmf) as a vendored package, and the shared Rubin bibliographies are downloaded by a `sync-bibs` make target.

## Template variables

### cookiecutter.title

The title of the technote.

### cookiecutter.description

A short description of the technote's content and purpose, used as the initial abstract.

### cookiecutter.series

The identifier of the technote series.

### cookiecutter.serial_number

The serial number, assigned by the Slack bot or the next available number in the series.

### cookiecutter.author_id

The author's ID in lsst-texmf's [authordb.yaml](https://github.com/lsst/lsst-texmf/blob/main/etc/authordb.yaml) file.

### cookiecutter.first_author_given, first_author_family, first_author_orcid, first_author_affil_name, first_author_affil_internal_id, first_author_affil_address

The first author's name, ORCID iD, and affiliation, written into `technote.toml`.

### cookiecutter.github_org

The GitHub organization where the technote resides.

### cookiecutter.copyright_year, copyright_holder

The copyright statement written into the COPYRIGHT file.
18 changes: 18 additions & 0 deletions project_templates/technote_typst/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from templatekit.builder import cookiecutter_project_builder

# Run cookiecutter to generate the 'TESTN-000' report
env = Environment(BUILDERS={"Cookiecutter": cookiecutter_project_builder})
env.Cookiecutter(
AlwaysBuild(Dir("TESTN-000")),
"cookiecutter.json",
cookiecutter_context={
"series": "TESTN",
"first_author_given": "First",
"first_author_family": "Author",
"first_author_orcid": "https://orcid.org/0000-0003-3001-676X",
"first_author_author_id": "test",
"first_author_affil_name": "Rubin Observatory",
"first_author_affil_internal_id": "RubinObs",
"first_author_affil_address": "950 N. Cherry Ave., Tucson, AZ 85719, USA",
},
)
57 changes: 57 additions & 0 deletions project_templates/technote_typst/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"author_id": "ID from lsst-texmf/etc/authordb.yaml",
"series": [
"DMTN",
"CTN",
"ITTN",
"RTN",
"PSTN",
"SMTN",
"SOTN",
"SQR",
"TSTN",
"TESTN"
],
"serial_number": "000",
"title": "Document Title",
"repo_name": "{{ cookiecutter.series.lower() }}-{{ cookiecutter.serial_number }}",
"github_org": [
"lsst",
"lsst-dm",
"lsst-it",
"lsst-pst",
"lsst-sims",
"lsst-so",
"lsst-sqre",
"lsst-tstn",
"lsst-sqre-testing"
],
"github_namespace": "{{ cookiecutter.github_org }}/{{ cookiecutter.repo_name }}",
"docushare_url": "",
"url": "https://{{ cookiecutter.series.lower() }}-{{ cookiecutter.serial_number }}.lsst.io",
"description": "A short description of this document",
"copyright_year": "{% now 'utc', '%Y' %}",
"copyright_holder": [
"Association of Universities for Research in Astronomy, Inc. (AURA)",
"Brookhaven Science Associates, LLC",
"California Institute of Technology",
"Fermi Research Alliance, LLC",
"The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory",
"The Trustees of Princeton University",
"University of Illinois Board of Trustees",
"University of Washington"
],
"first_author_given": "",
"first_author_family": "",
"first_author_orcid": "",
"first_author_affil_name": "",
"first_author_affil_internal_id": "",
"first_author_affil_address": "",
"_copy_without_render": [
"*.bib"
],
"_extensions": [
"jinja2_time.TimeExtension",
"templatekit.TemplatekitExtension"
]
}
76 changes: 76 additions & 0 deletions project_templates/technote_typst/templatekit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: "Technote (Typst)"
group: "Documents"
dialog_title: "Create a Typst technote"
dialog_fields:
- key: "title"
label: "Technote title"
placeholder: ""
hint: "Don't include the document's handle and avoid Typst markup."
component: "textarea"
- key: "description"
label: "Abstract or description"
hint: "Plain text works best here."
component: "textarea"
placeholder: ""
- key: "author_id"
label: "First author's ID"
hint: "ID is a key from lsst-texmf's authordb.yaml (http://ls.st/uyr)"
component: "text"
placeholder: ""
- label: "Series"
component: "select"
preset_options:
- label: "DMTN"
value: "dmtn"
presets:
series: "DMTN"
github_org: "lsst-dm"
- label: "CTN"
value: "ctn"
presets:
series: "CTN"
github_org: "lsst"
- label: "ITTN"
value: "ittn"
presets:
series: "ITTN"
github_org: "lsst-it"
- label: "PSTN"
value: "PSTN"
presets:
series: "PSTN"
github_org: "lsst-pst"
org: "PST"
- label: "RTN"
value: "rtn"
presets:
series: "RTN"
github_org: "lsst"
- label: "SMTN"
value: "smtn"
presets:
series: "SMTN"
github_org: "lsst-sims"
- label: "SOTN"
value: "sotn"
presets:
series: "SOTN"
github_org: "lsst-so"
- label: "SQR"
value: "sqr"
presets:
series: "SQR"
github_org: "lsst-sqre"
- label: "TSTN"
value: "tstn"
presets:
series: "TSTN"
github_org: "lsst-tstn"
- label: "Test"
value: "test"
presets:
series: "TESTN"
github_org: "lsst-sqre-testing"
- label: "Initial copyright holder"
key: "copyright_holder"
component: "select"
125 changes: 125 additions & 0 deletions project_templates/technote_typst/testn-000/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: CI

'on': [push, pull_request, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # full history for landing-page metadata

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Python install
run: |
python -m pip install --upgrade pip
python -m pip install "lander<2.0.0" setuptools

- uses: typst-community/setup-typst@v5
with:
typst-version: '0.15.0'

- name: Typst build
run: make pdf

# Independent audit of the archival (PDF/A-2a) and accessibility
# (PDF/UA-1) conformance that the build enforces, using veraPDF.
# This covers the machine-checkable requirements; alt-text quality
# and reading order still need human review.
- name: Validate PDF/A and PDF/UA conformance
run: |
for flavour in 2a ua1; do
docker run --rm -v "$PWD":/data verapdf/cli \
--flavour $flavour --format text \
"/data/TESTN-000.pdf" \
| tee "verapdf-$flavour.txt"
done
! grep -h "^FAIL" verapdf-*.txt

# The landing page metadata comes from technote.toml and from the
# compiled document's own <rubin-technote> front matter, so author,
# title, and abstract changes are picked up automatically.
- name: Landing page upload
if: ${{ github.event_name == 'push' }}
env:
LTD_PASSWORD: ${{ secrets.LTD_PASSWORD }}
LTD_USERNAME: ${{ secrets.LTD_USERNAME }}
run: |
python3 - <<'EOF'
import json
import os
import subprocess
import tomllib

with open("technote.toml", "rb") as fh:
technote = tomllib.load(fh)["technote"]

# The flags mirror the compile command in the Makefile.
query = subprocess.run(
[
"typst", "query",
"--root", ".",
"--package-path", ".typst-packages",
"--font-path", ".typst-packages/preview/rubin-technote/0.1.0/fonts",
"index.typ",
"<rubin-technote>",
"--field", "value",
"--one",
],
check=True,
capture_output=True,
text=True,
)
front_matter = json.loads(query.stdout)

def plain_text(node):
"""Flatten queried Typst content to plain text."""
if node is None:
return ""
if isinstance(node, str):
return node
if isinstance(node, list):
return "".join(plain_text(child) for child in node)
if isinstance(node, dict):
func = node.get("func")
if func == "text":
return node.get("text", "")
if func == "space":
return " "
if func in ("parbreak", "linebreak"):
return "\n"
return plain_text(
node.get("children") or node.get("body") or node.get("child")
)
return ""

authors = [
" ".join(
part
for part in (author["name"].get("given"), author["name"]["family"])
if part
)
for author in technote.get("authors", [])
]
command = [
"lander",
"--upload",
"--pdf", "TESTN-000.pdf",
"--ltd-product", "testn-000",
"--handle", technote["id"],
"--title", plain_text(front_matter["title"]).strip(),
"--authors", json.dumps(authors),
"--repo-url", technote["github_url"],
"--repo-branch", os.environ["GITHUB_REF_NAME"],
]
abstract = plain_text(front_matter.get("abstract")).strip()
if abstract:
command.extend(("--abstract", abstract))
subprocess.run(command, check=True)
EOF
7 changes: 7 additions & 0 deletions project_templates/technote_typst/testn-000/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.pdf
lsstbib/
.typst-packages/
.typst-tmp/
.tox/
venv/
.venv/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# - id: trailing-whitespace
- id: check-yaml
- id: check-toml
1 change: 1 addition & 0 deletions project_templates/technote_typst/testn-000/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright 2026 Association of Universities for Research in Astronomy, Inc. (AURA)
Loading
Loading