Skip to content

Commit

Permalink
feat(core): revamp escape mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
nvlang committed May 21, 2024
1 parent a4f9943 commit 23a5548
Show file tree
Hide file tree
Showing 137 changed files with 7,899 additions and 6,084 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules
dist
ideas
external
legacy
docs
.VSCodeCounter
.github
.vscode
.husky
15 changes: 15 additions & 0 deletions .github/workflows/jsr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Publish to JSR

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # The OIDC ID token is used for authentication with JSR.
steps:
- uses: actions/checkout@v4
- run: npx jsr publish
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish
- run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
16 changes: 12 additions & 4 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
name: Playwright Tests
on:
push:
branches: [main, master]
branches: [main]
pull_request:
branches: [main, master]
branches: [main]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: xu-cheng/texlive-action@v2
with:
scheme: small
run: |
apk add make
make
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install PNPM
run: npm install -g pnpm
- name: Install Node.js dependencies
run: pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@ dist
examples
external
ideas
legacy
node_modules
playwright-report
static
test-results
tmp

# Generated by Sveltex in E2E tests
**/sveltex/fonts/**
**/sveltex/*.css

.VSCodeCounter

#——————————————————————————————————————————————————————————#
Expand Down
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Extend the Playwright Docker image
FROM mcr.microsoft.com/playwright:v1.44.0-jammy

# Set environment variables to skip interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC

# Install TeX Live for LaTeX document compilation
RUN apt-get update && \
apt-get install -y texlive tzdata && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install Node.js dependencies (assuming package.json is present)
COPY package*.json ./
RUN npm install

# Copy the rest of your application
COPY . .

# Entrypoint for your application (adjust as needed)
CMD ["npm", "run", "test:e2e"]
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Sveltex = Svelte + $\TeX$
# Sveltex = Svelte + $\mathrm{\TeX}$

[![JSR](https://jsr.io/badges/@nvlang/sveltex?style=flat-square&labelColor=1A3644)](https://jsr.io/@nvlang/sveltex)
[![NPM Version](https://img.shields.io/npm/v/sveltex-preprocess?style=flat-square&logo=npm&logoColor=white&label=&labelColor=BD453B&color=BD453B)](https://npmjs.com/sveltex-preprocess)
[![GitHub Tag](https://img.shields.io/github/v/tag/nvlang/sveltex?style=flat-square&logo=GitHub&logoColor=aaa&label=&labelColor=333&color=333)](https://github.com/nvlang/sveltex)
[![Codecov](https://img.shields.io/codecov/c/github/nvlang/sveltex?style=flat-square&logo=codecov&label=&logoColor=aaa&labelColor=333&color=333)]()

- NPM: [sveltex-preprocess](https://npmjs.com/sveltex-preprocess)
- JSR: [@nvlang/sveltex](https://jsr.io/@nvlang/sveltex)
- GitHub: [nvlang/sveltex](https://github.com/nvlang/sveltex)

## Installation

```sh
Expand All @@ -17,7 +13,12 @@

## Documentation

TODO
### Quickstart

```js
// svelte.config.js
import { sveltex } from 'sveltex-preprocess';
```

## How it works

Expand All @@ -34,6 +35,7 @@ In alphabetical order:
- Improve source map support.
- Support preprocessing LaTeX content before passing it to MathJax/KaTeX.
- VSCode extension for proper syntax highlighting of `.sveltex` files.
- Yeoman generator for scaffolding new Sveltex projects.

## Contributing

Expand Down
4 changes: 3 additions & 1 deletion docs/advanced/tex-texlive/caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ apply:
```js sveltex.config.js
import { sveltex } from 'sveltex-preprocess';

export const sveltexPreprocessor = await sveltex({ advancedTexBackend: 'local' })
export const sveltexPreprocessor = await sveltex({
advancedTexBackend: 'local',
});

await sveltexPreprocessor.configure({
advancedTex: {
Expand Down
Loading

0 comments on commit 23a5548

Please sign in to comment.