Skip to content
Open
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
47 changes: 47 additions & 0 deletions .github/workflows/deploy-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy Manual

on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 24
cache: 'npm'
cache-dependency-path: manual/package-lock.json

- name: Install dependencies
run: npm ci
working-directory: ./manual

- name: Build
run: npm run build
working-directory: ./manual

- name: Create nojekyll
run: echo > ./manual/dist/.nojekyll

- name: Deploy to gh-pages
if: ${{ github.event_name == 'push' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./manual/dist
force_orphan: true
29 changes: 21 additions & 8 deletions manual/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
*.aux
*.log
*.out
*.toc
*.xdv
*.fdb_latexmk
*.fls
*.pyg
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
24 changes: 24 additions & 0 deletions manual/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# LemonLime 用户手册

该文件夹储存 LemonLime 用户手册源代码。

用户手册使用 Typst 编写,源代码储存于 `manual/src/content` 目录中。

用户手册有两种分发模式:线上分发与线下分发。

线下分发需要手动编译 Typst 文件,在此之前,你需要下载以下字体:

- [Noto Serif CJK SC](https://github.com/notofonts/noto-cjk/releases/tag/Serif2.003)
- [Noto Sans CJK SC](https://github.com/notofonts/noto-cjk/releases/tag/Sans2.004)
- [LXGW WenKai](https://github.com/lxgw/LxgwWenKai/releases)
- [Courier Prime Code](https://quoteunquoteapps.com/courierprime/downloads/courier-prime-code.zip)

然后使用 Typst CLI 或者 Tinymist Typst 编译 `manual/src/content/manual.typ`,将生成出来的 pdf 重命名并放在 `manual/llmanual.pdf`。注意,需要开启 `--features html`。

线上分发使用使用 astro+[astro-typst](https://github.com/OverflowCat/astro-typst)+[starlight theme](https://starlight.astro.build/) 部署于线上。

`docs` 文件夹下的文件:

- `manual.typ`:手册文件,include 了所有文章,供 pdf 导出使用;
- `lib.typ`:手册文件的样式,供 pdf 导出使用;
- `html.typ`:网页文件的一些 hook,劫持了数学公式、图片、标题(网页中不显示标题,因为已经有一个了),其中图片通过调用 JSX 组件 `<Image>` 实现,未来 astro-typst 的 API 可能会更换,需要及时更改。由于 `<Image>` 必须提供 `alt`,在文件中插入图片时必须包含 `alt`。
39 changes: 39 additions & 0 deletions manual/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// @ts-check
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import { typst } from 'astro-typst';

// https://astro.build/config
export default defineConfig({
site: 'https://project-lemonlime.github.io',
base: 'Project_LemonLime',
integrations: [
starlight({
title: 'LemonLime Manual',
tableOfContents: false,
favicon: '/favicon.png',
social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/Project-LemonLime/Project_LemonLime' }],
sidebar: [
{
label: 'Manual',
items: [
{ label: '快速开始', slug: 'quickstart' },
{ label: '简介', slug: 'intro' },
{ label: '安装', slug: 'install' },
{ label: '设置', slug: 'settings' },
{ label: '比赛', slug: 'contest' },
{ label: '测试', slug: 'judge' },
{ label: '比赛统计', slug: 'statistics' },
{ label: '常见问题及回答', slug: 'issue' },
],
},
],
}),
typst({
options: {
remPx: 14,
},
target: "html",
}),
],
});
5 changes: 0 additions & 5 deletions manual/latexmkrc

This file was deleted.

Binary file modified manual/llmanual.pdf
Binary file not shown.
Loading
Loading