Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 Add typst templates to API #38

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- run: npm run build:cli
- run: npm run link
- name: Clone and index templates
run: myst-templates-api index data/tex.yml data/docx.yml data/site.yml
run: myst-templates-api index data/tex.yml data/docx.yml data/site.yml data/typst.yml
- run: npm run build
- run: vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Update organization readme
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ jobs:
- run: npm run build:cli
- run: npm run link
- name: Clone and index templates
run: myst-templates-api index data/tex.yml data/docx.yml data/site.yml
run: myst-templates-api index data/tex.yml data/docx.yml data/site.yml data/typst.yml
- run: npm run test
10 changes: 10 additions & 0 deletions data/typst.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
kind: typst
templates:
- organization: myst
name: ieee-typst
source: https://github.com/myst-templates/ieee-typst-template
latest: main
- organization: myst
name: lapreprint-typst
source: https://github.com/myst-templates/lapreprint-typst
latest: main
53 changes: 20 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
"express": "^4.18.2",
"js-yaml": "^4.1.0",
"myst-cli-utils": "^2.0.6",
"myst-common": "^1.1.13",
"myst-templates": "^1.0.12",
"myst-common": "^1.1.20",
"myst-templates": "^1.0.14",
"node-fetch": "^3.3.1",
"simple-validators": "^1.0.3",
"simple-validators": "^1.0.4",
"unist-util-remove": "^3.1.1",
"unist-util-select": "^4.0.3",
"vercel": "^30.2.2"
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ import {
} from './utils';
import docxTemplates from './data/docx.json';
import texTemplates from './data/tex.json';
import typstTemplates from './data/typst.json';
import siteTemplates from './data/site.json';
import type { TemplateItem } from '../cli/types';
import type { TemplateYml } from 'myst-templates';

const TEMPLATES = {
tex: texTemplates,
typst: typstTemplates,
docx: docxTemplates,
site: siteTemplates,
} as Record<string, { info: TemplateItem; template: TemplateYml; kind: string }[]>;
Expand All @@ -40,6 +42,7 @@ app.get('/templates', (req, res) => {
version,
links: {
tex: asUrl('/templates/tex'),
typst: asUrl('/templates/typst'),
docx: asUrl('/templates/docx'),
site: asUrl('/templates/site'),
},
Expand Down