Skip to content

myst-templates/templates

Repository files navigation

MyST Templates

A community curated collection of MyST Markdown compatible templates. These templates allow myst to export markdown files as typeset, formatted documents using PDF, LaTeX, Typst, or Word. Templates can expose data-driven options for customization ensuring the final documents comply with author submission guidelines provided by a particular journal, conference organizer or university.

This repository:

  • holds issues for new and general information for improving existing templates
  • downloads each template listed in the data folder
  • implements a lightweight API that serves an index of template metadata
  • automatically updates the organization readme

Contributing a LaTeX or Typst Template

To add a new LaTeX template, fork this repo, and modify tex.yml, the new template should be added as a new entry in the listing:

templates:
  - organization: myst
    name: agu2019
    source: https://github.com/myst-templates/agu2019
    latest: main

Once you've made your change, open a PR.

Contributing a Docx Template

Docx templating currently requires a dynamic rendering function using docx passed directly to mystmd. However, data-driven options specified by a template.yml are still passed to this renderer. These may be added at docx.yml, similar to LaTeX template.

Fork this repo, make your change and open a PR.

Modifying the Template Index

To add, remove or update a template in the index, you need to build and run the CLI tool.

  1. Install the mini CLI tool using npm install
  2. Run npm run build:cli
  3. Run npm run link

After you have made your changes to a specific index file(s), call myst-templates-api index data/tex.yml from the main folder, which will create an index file and update the organization Readme.

Source locations

  • ./cli: CLI for generating JSON data files from data/x.yml and template clone.
  • ./src: Server for JSON data files.

Local deployment

To run the API server locally for development and testing:

  1. npm install

  2. git clone [email protected]:myst-templates/.github.git readme

The tool wants to populate a README with a list of templates. Provide it with an example.

  1. npm run build
  • Build CLI into ./dist.
  • Build API server into ./api.
  1. node dist/myst-templates-api.cjs index data/*.yml

Combine JSON data files in data/*.yml with template information, obtained from cloned template repos.

  1. npm run copy:data

Copy JSON data into src/data.

  1. node server.js

Serve data on https://localhost:10000.

About

List of all MyST Markdown community templates.

Resources

Stars

Watchers

Forks

Contributors 7