Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nvlang committed Jun 28, 2024
1 parent 9cc493e commit 1239dc1
Show file tree
Hide file tree
Showing 1,804 changed files with 964 additions and 1,052 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Deploy to Cloudflare Pages. If a push to a non-production branch is done, it
# will deploy as a preview deployment.
name: Deploy to Cloudflare Pages

on:
push:
branches:
- mainfdsafdsfdsfsdfds
# push:
# paths:
# - 'docs/**'

jobs:
deploy:
runs-on: ubuntu-latest

permissions:
contents: read
deployments: write

name: Deploy to Cloudflare Pages

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set working directory
run: cd docs

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: latest
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: latest
cache: pnpm
cache-dependency-path: ./pnpm-lock.yaml

- name: Install dependencies
working-directory: docs
run: pnpm install

- name: Build
run: pnpm run build

- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
# Your Cloudflare API Token. See
# https://developers.cloudflare.com/pages/how-to/use-direct-upload-with-continuous-integration/#generate-an-api-token
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}

# Your Cloudflare Account ID. See
# https://developers.cloudflare.com/pages/how-to/use-direct-upload-with-continuous-integration/#get-project-account-id
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

# The Wrangler command (along with any arguments) you wish to run.
# Multiple Wrangler commands can be run by separating each command
# with a newline. Defaults to `deploy`.
command: pages deploy .vitepress/dist --project-name=SvelTeX

# The package manager you'd like to use to install and run wrangler.
# If not specified, the preferred package manager will be inferred
# based on the presence of a lockfile or fallback to using npm if no
# lockfile is found. Valid values are `npm`, `pnpm`, `yarn`, and
# `bun`.
packageManager: pnpm

# By default Wrangler will run in the root package directory. If you
# want to specify a subdirectory of the repo from which to run the
# Wrangler command, you can add `workingDirectory:
# YOUR_PACKAGE_DIRECTORY` here. This can be useful for apps that live
# in monorepos, for example.

# Optional: Change the Wrangler version, allows you to point to a
# specific version or a tag such as `beta`
# wranglerVersion: '3'
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ docs/.vitepress/cache/
docs/.vitepress/cache/**/*

# Fonts
*.woff2
*.woff
*.ttf
*.otf
{src,tests}/**/*.woff2
{src,tests}/**/*.woff
{src,tests}/**/*.ttf
{src,tests}/**/*.otf

# Generated by Sveltex in E2E tests
**/sveltex/fonts/**
Expand Down
37 changes: 29 additions & 8 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,29 @@ import { githubDarkDefault } from './theme/code-theme.js';
import markdownItMultimdTable from 'markdown-it-multimd-table';
import footnote from 'markdown-it-footnote';

export const ESBUILD_MODULES_TARGET = [
'es2022',
// 'edge89',
// 'firefox89',
'chrome126',
// 'safari15',
];

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'SvelTeX',
description: 'Flexible Svelte preprocessor with extensive LaTeX support.',
vite: {
optimizeDeps: {
exclude: ['@nvl/sveltex'],
esbuildOptions: { target: ESBUILD_MODULES_TARGET },
},
esbuild: { target: ESBUILD_MODULES_TARGET },
build: {
rollupOptions: { external: ['@nvl/sveltex'] },
target: ESBUILD_MODULES_TARGET,
},
},
markdown: {
theme: {
light: 'github-light-default',
Expand All @@ -18,16 +37,16 @@ export default defineConfig({
math: true,
codeTransformers: [transformerTwoslash()],
config: (md) => {
md.use(footnote);
md.use(footnote as any);
(md as any).use(markdownItMultimdTable, {
autolabel: true,
headerless: true,
multibody: true,
multiline: true,
rowspan: true,
});
md.use(container, 'info', {
render: (tokens, idx) => {
md.use(container as any, 'info', {
render: (tokens: any, idx: any) => {
const token = tokens[idx];
if (token.nesting === 1) {
// Opening tag
Expand All @@ -47,8 +66,8 @@ export default defineConfig({
}
},
});
md.use(container, 'warning', {
render: (tokens, idx) => {
md.use(container as any, 'warning', {
render: (tokens: any, idx: any) => {
const token = tokens[idx];
if (token.nesting === 1) {
// Opening tag
Expand All @@ -69,8 +88,8 @@ export default defineConfig({
}
},
});
md.use(container, 'danger', {
render: (tokens, idx) => {
md.use(container as any, 'danger', {
render: (tokens: any, idx: any) => {
const token = tokens[idx];
if (token.nesting === 1) {
// Opening tag
Expand Down Expand Up @@ -142,7 +161,9 @@ export default defineConfig({
},
{
text: 'Examples',
link: '/docs/examples',
base: '/docs/examples',
collapsed: false,
items: [{ text: 'Basic', link: '/basic' }],
},
{
text: 'Implementation',
Expand Down
15 changes: 15 additions & 0 deletions docs/.vitepress/theme/fonts/monaspace.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
src: url('/fonts/monaspace/MonaspaceArgon-Medium.woff2') format('woff2');
}

@font-face {
font-family: 'Monaspace Argon';
font-style: normal;
font-weight: 600;
src: url('/fonts/monaspace/MonaspaceArgon-SemiBold.woff2') format('woff2');
}

@font-face {
font-family: 'Monaspace Argon';
font-style: normal;
Expand All @@ -38,6 +45,14 @@ We're sort of "lying" with the italics here, and using Monaspace Radon instead.
format('woff2');
}

@font-face {
font-family: 'Monaspace Argon';
font-style: italic;
font-weight: 600;
src: url('/fonts/monaspace/MonaspaceRadon-SemiBoldItalic.woff2')
format('woff2');
}

@font-face {
font-family: 'Monaspace Argon';
font-style: italic;
Expand Down
3 changes: 1 addition & 2 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
});
},
enhanceApp({ app, router, siteData }) {
enhanceApp({ app }) {
app.use(TwoslashFloatingVue);
app.use(FloatingVue, { boundary: 'body' });
app.component('PhInfo', PhInfo);
Expand All @@ -35,4 +35,3 @@ export default {
// app.component('PhBird', PhBird);
},
} satisfies Theme;
// .vitepress/theme/index.ts
17 changes: 8 additions & 9 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",
"docs:preview": "vitepress preview",
"dev": "pnpm run docs:dev --port 3010"
"dev": "vitepress dev --port 3010",
"build": "vitepress build",
"preview": "vitepress preview"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@nvl/sveltex": "file:..",
"@shikijs/vitepress-twoslash": "^1.6.1",
"@shikijs/vitepress-twoslash": "^1.10.0",
"@tailwindcss/typography": "^0.5.13",
"@types/markdown-it-container": "^2.0.10",
"@types/markdown-it-footnote": "^3.0.4",
Expand All @@ -28,10 +27,10 @@
"postcss": "^8.4.38",
"postcss-import": "^16.1.0",
"postcss-load-config": "^6.0.1",
"prettier-plugin-tailwindcss": "^0.6.1",
"tailwindcss": "^3.4.3",
"vitepress": "^1.2.2",
"vue": "^3.4.27"
"prettier-plugin-tailwindcss": "^0.6.5",
"tailwindcss": "^3.4.4",
"vitepress": "^1.2.3",
"vue": "^3.4.31"
},
"dependencies": {
"@phosphor-icons/vue": "^2.2.1",
Expand Down
Loading

0 comments on commit 1239dc1

Please sign in to comment.