diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..14fcb50 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: CI + +on: + push: + paths: + - '*.typ' + pull_request: + paths: + - '*.typ' + workflow_dispatch: + +jobs: + compile: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: yusancky/setup-typst@v2 + with: + version: latest + - name: Compile + run: | + typst compile physica-manual.typ + typst compile demo.typ + - uses: actions/upload-artifact@v3 + with: + name: PDF + path: '*.pdf' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3c2da63 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: 🚀 Release + +on: + push: + tags: + - "v*.*.*" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: yusancky/setup-typst@v2 + with: + version: latest + - name: Compile the manual + run: typst compile physica-manual.typ + - name: Release + id: release + uses: softprops/action-gh-release@v1 + with: + name: Physica ${{ github.ref_name }} + files: physica-manual.pdf + fail_on_unmatched_files: true + - name: Generate the job summary + run: echo '🎉 [Release for ${{ github.ref_name }}](${{ steps.release.outputs.url }}) is ready.' >> $GITHUB_STEP_SUMMARY diff --git a/README.md b/README.md index ffa31fb..6c522b6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # The physica module (for physics) -Current semantic version: `0.7`. [Manual](https://github.com/Leedehai/typst-physics/blob/master/physica-manual.pdf). +[![CI](https://github.com/Leedehai/typst-physics/actions/workflows/ci.yml/badge.svg)](https://github.com/Leedehai/typst-physics/actions/workflows/ci.yml) +[![Latest release date](https://img.shields.io/github/release-date/Leedehai/typst-physics)][latest-release] + +Current semantic version: `0.7`. [Manual][latest-manual]. Available at [https://typst.app/docs/packages/](https://typst.app/docs/packages/). @@ -24,7 +27,7 @@ everybody", this package was renamed from `physics` to `physica`. ## A quick look -See the [manual](https://github.com/Leedehai/typst-physics/blob/master/physica-manual.pdf) for more details. +See the [manual][latest-manual] for more details. ![demo](https://user-images.githubusercontent.com/18319900/236073825-e91b4601-7e92-490b-a7e4-e9e405a2147b.png) @@ -42,25 +45,25 @@ $op("curl")(op("grad") f) = curl (grad f)$ ### Without `typst` package management -* To use the `physics` package, simply insert `#import "physics.typ": *` at the +* To use the `physica` package, simply insert `#import "physica.typ": *` at the beginning of your document. * To reduce the possibility of name collisions, you may want to import the -package under name scope `physics`: +package under name scope `physica`: ``` - #import "physics.typ" + #import "physica.typ" - $op("curl")(op("grad") f) = physics.curl (physics.grad f)$ + $op("curl")(op("grad") f) = physica.curl (physica.grad f)$ ``` * You may also import names specifically: ``` - #import "physics.typ": curl, grad + #import "physica.typ": curl, grad $op("curl")(op("grad") f) = curl (grad f)$ ``` ## Manual -See the manual [physics-manual.pdf](https://github.com/Leedehai/typst-physics/blob/master/physica-manual.pdf) for a more comprehensive coverage, a PDF file +See the manual [physica-manual.pdf][latest-manual] for a more comprehensive coverage, a PDF file generated directly with the [Typst](https://typst.app) binary. CLI Version: @@ -73,7 +76,7 @@ typst 0.6.0 (2dfd44fe) To regenerate the manual, use command ```sh -typst watch physics-manual.typ +typst watch physica-manual.typ ``` ## Contribution @@ -85,10 +88,13 @@ request. If it is large, the best first step is creating an issue and let us explore the design together. Some features might warrant a package on its own. * Testing: currently testing is done by closely inspecting the generated -[physics-manual.pdf](physics-manual.pdf). This does not scale well. I plan to add programmatic +[physica-manual.pdf][latest-manual]. This does not scale well. I plan to add programmatic testing by comparing rendered pictures with golden images. ## License * Code: the [MIT License](LICENSE.txt). * Docs: the [Creative Commons BY-ND 4.0 license](https://creativecommons.org/licenses/by-nd/4.0/). + +[latest-release]: https://github.com/Leedehai/typst-physics/releases/latest "The latest release" +[latest-manual]: https://github.com/Leedehai/typst-physics/releases/latest/download/physica-manual.pdf "Download the latest manual" diff --git a/demo.typ b/demo.typ index ff95db1..fb91f62 100644 --- a/demo.typ +++ b/demo.typ @@ -1,8 +1,8 @@ // Copyright 2023 Leedehai // Use of this code is governed by a MIT license in the LICENSE.txt file. -// For a manual on this package, see physics-manual.pdf. +// For a manual on this package, see physica-manual.pdf. -#import "physics.typ": * +#import "physica.typ": * $ curl vb(E) = - pdv(vb(B), t), diff --git a/physica-manual.pdf b/physica-manual.pdf deleted file mode 100644 index a245b37..0000000 Binary files a/physica-manual.pdf and /dev/null differ diff --git a/physica.typ b/physica.typ index 5e7e523..991083a 100644 --- a/physica.typ +++ b/physica.typ @@ -1,6 +1,6 @@ // Copyright 2023 Leedehai // Use of this code is governed by a MIT license in the LICENSE.txt file. -// Current version: 0.7.5. Please see physics-manual.pdf for user docs. +// Current version: 0.7.5. Please see physica-manual.pdf for user docs. // Returns whether a Content object holds an integer. The caller is responsible // for ensuring the input argument is a Content object.