Giter Club home page Giter Club logo

setup-typst's Introduction

Setup Typst

This action provides the following functionality for GitHub Actions users:

  • Installing a version of Typst and adding it to the PATH
  • Optionally caching packages dependencies
- uses: typst-community/setup-typst@v3
- run: typst compile paper.typ paper.pdf

Usage

GitHub Actions GitHub

Basic usage

name: Render paper.pdf
on: push
jobs:
  render-paper:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: typst-community/setup-typst@v3
        with:
          cache-dependency-path: requirements.typ
      # Now Typst is installed and packages will be cached!
      - run: typst compile paper.typ paper.pdf

Inputs

  • typst-token: The GitHub token to use when pulling versions from typst/typst. By default this should cover all cases. You shouldn't have to touch this setting.
  • typst-version: The version of Typst to install. This can be an exact version like 0.10.0 or a semver range like 0.10 or 0.x. You can also specify latest to always use the latest version. The default is latest.
  • cache-dependency-path: Used to specify the path to dependency file. Supports a Typst file with lines of import keyword.

Outputs

  • typst-version: The version of Typst that was installed. This will be something like 0.10.0 or similar.
  • cache-hit: Whether or not Typst was restored from the runner's cache or download anew.

Custom combinations

Uploading workflow artifact

- uses: typst-community/setup-typst@v3
  with:
    cache-dependency-path: requirements.typ
- run: typst compile paper.typ paper.pdf
- uses: actions/upload-artifact@v4
  with:
    name: paper
    path: paper.pdf

Expanding font support with Fontist

If your tasks require extending beyond the set of fonts in GitHub Actions runner, you can employ the Fontist to facilitate custom font installations. Here's an example showcasing how to use [fontist/setup-fontist] to add new fonts:

- uses: fontist/setup-fontist@v2
- run: fontist install "Fira Code"
- uses: typst-community/setup-typst@v3
  with:
    cache-dependency-path: requirements.typ
- run: typst compile paper.typ paper.pdf --font-path ~/.fontist/fonts

Development

Node.js

How do I test my changes?

Open a draft Pull Request and some magic GitHub Actions will run to test the action.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.