3 Commits
Author SHA1 Message Date
HEL 9fdc003a71 chore: allow passing commit hash through inputs
Compile manual / ci (pull_request) Successful in 1m45s
2026-07-07 19:07:52 +02:00
HEL 496413415f chore: add ci to compile manual
Compile manual / ci (pull_request) Failing after 4m1s
2026-07-07 18:44:21 +02:00
HEL 7c5e657e77 chore: update README 2026-07-07 18:05:12 +02:00
7 changed files with 10349 additions and 16 deletions
+48
View File
@@ -0,0 +1,48 @@
name: Compile manual
on:
push:
branches:
- main
- master
pull_request:
branches:
- "**"
jobs:
ci:
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- name: Setup Fontist
uses: fontist/setup-fontist@v2
- name: Install Fonts
run: fontist manifest install docs/fonts.yaml
- uses: typst-community/setup-typst@v5
with:
typst-version: "0.15.0"
zip-packages: docs/requirements.json
cache-local-packages: true
token: ""
- run: |
typst compile \
--root . \
--font-path ~/.fontist/fonts \
--input hash=${{ gitea.sha }} \
docs/manual.typ \
docs/manual.pdf
- name: Upload artifact
uses: christopherhx/gitea-upload-artifact@v4
with:
name: manual
path: docs/manual.pdf
+16 -12
View File
@@ -51,16 +51,7 @@ This framework is being developed as part of a Bachelor's Thesis by Louis Herede
## Commands
<!--
check
compile
format
highlight
parse
dump_registry
types
validate
-->
Hereafter is a description of the commands you can use with Midas. For a full description, refer to [the manual](./docs/manual.pdf).
### Type Checking
@@ -78,6 +69,10 @@ midas compile -t types.midas source.py
With the `compile` command, you can process a source Python file, with any number of custom type definition files (`-t FILE` option), and the type checker will verify the coherence of your program and generate the runnable code with valid syntax and runtime assertions.
> [!WARNING]
> By default, any type checking error aborts the compilation and the generator is not run. You can bypass this behaviour with the `--ignore-errors` flag.
> Only use this flag if you know what you are doing as it will produce a possibly unsafe program and goes against the whole purpose of Midas
### Formatting
```shell
@@ -143,7 +138,7 @@ This command lets you validate a Midas definition file by running the parser and
## Tests
Several snapshot tests are available to assert the good behaviour of the parsers and type checker. They can be run as follows:
Several snapshot tests are available to assert the good behaviour of the parser, type checker and generator. They can be run as follows:
```shell
uv run -m tests.midas run -a
@@ -152,7 +147,16 @@ uv run -m tests.checker run -a
uv run -m tests.generator run -a
```
**Available subcommands:**
Alternatively, you can run all tests by executing the `tests` module directly:
```shell
uv run -m tests
```
When running only one test group, you may use one of the following subcommands.\
Not specifying any subcommand is equivalent to running `run -a`
**Available subcommands**:
- Run all tests: `run -a`
- Run specific tests: `run tests/cases/test1.py tests/cases/test2.py ...`
- Update all tests: `update -a`
+2
View File
@@ -0,0 +1,2 @@
Source Sans Pro:
Source Sans 3:
+10260
View File
File diff suppressed because it is too large Load Diff
+11 -2
View File
@@ -8,8 +8,17 @@
#import "@preview/gentle-clues:1.3.1" as gc
#let midas-version = toml("../pyproject.toml").project.version
#let head-ref = read("../.git/HEAD").split(":").at(1).trim()
#let commit-hash = read("../.git/" + head-ref).slice(0, 8)
#let commit-hash = if "hash" in sys.inputs {
sys.inputs.hash.slice(0, 8)
} else {
let head-ref = read("../.git/HEAD").split(":").at(1, default: "").trim()
if head-ref.len() != 0 {
read("../.git/" + head-ref).slice(0, 8)
} else {
none
}
}
#show: project.with(
title: [Midas User Manual],
+6
View File
@@ -0,0 +1,6 @@
{
"preview": {},
"local": {
"codly": "https://github.com/LordBaryhobal/codly-fix-v15/archive/refs/tags/v1.3.1-fix.zip"
}
}
+6 -2
View File
@@ -52,7 +52,7 @@
title: none,
author: none,
version: "0.0.1",
hash: "abcdefgh",
hash: none,
icon-path: none,
doc,
) = {
@@ -69,13 +69,17 @@
set raw(syntaxes: path("midas.sublime-syntax"))
let front-page() = {
let version-name = [v#version]
if hash != none {
version-name = [#version-name - #hash]
}
align(center)[
#{
set text(size: 1.5em)
std.title()
}
v#version - #hash
#version-name
#if icon-path != none {
v(1cm)