- Editions replaced by INSTEG, HAREC and UPPGRADERING (Instegscertifikat -> HAREC) - Question pool optional; simulator, homework tool and solutions switch off without one - All UI strings, templates, renderers and project JS localised to sv-SE (decimal comma, Swedish non-breaking-space rules, Å/Ä/Ö in Morse table) - DARC branding, membership CTA and German links removed; attribution footer added - Page names centralised in src/pages.py - README and docs rewritten in Swedish Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
52 lines
1.5 KiB
Python
52 lines
1.5 KiB
Python
from typing import Annotated
|
|
|
|
import typer
|
|
|
|
import src.build as build
|
|
import src.config as config
|
|
from src.edition import Edition
|
|
|
|
app = typer.Typer()
|
|
|
|
|
|
@app.command()
|
|
def main(
|
|
edition: Annotated[list[Edition], typer.Option(help="Course to build, can be specified multiple times.")] = [ # noqa: B006 -- default value is required for typer
|
|
Edition.instegs,
|
|
Edition.harec,
|
|
Edition.uppgradering,
|
|
],
|
|
input: Annotated[str | None, typer.Option("--input", "-i", help="Content source directory.")] = None,
|
|
output: Annotated[str | None, typer.Option("--output", "-o", help="Destination directory to build to.")] = None,
|
|
render_editions: Annotated[bool, typer.Option(help="Skip building editions.")] = True,
|
|
render_solutions: Annotated[bool, typer.Option(help="Skip building solutions.")] = True,
|
|
build_zip: Annotated[bool, typer.Option(help="Whether to build a zip file of the output.")] = False,
|
|
) -> None:
|
|
conf = config.Config(content_path=input, build_path=output)
|
|
bd = build.Build(conf)
|
|
|
|
# Build surrounding website
|
|
bd.build_website()
|
|
|
|
if render_editions:
|
|
# Build individual editions
|
|
for e in edition:
|
|
bd.build_edition(e)
|
|
|
|
if render_solutions:
|
|
# Build solution pages
|
|
bd.build_solutions()
|
|
|
|
# Copy assets to build folder
|
|
bd.build_assets()
|
|
bd.build_question_index()
|
|
bd.build_index()
|
|
|
|
if build_zip:
|
|
# Build zip file of output
|
|
bd.build_zip()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
app()
|