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

chore: make compatible with dart-sass #160

Merged
merged 3 commits into from
Nov 2, 2024
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
14 changes: 12 additions & 2 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@ on:
pull_request:
types: [opened, synchronize, reopened]

env:
DART_SASS_VERSION: 1.79.6

jobs:
compile:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Dependencies
- name: Install Dart Sass
uses: robinraju/release-downloader@v1
with:
repository: 'sass/dart-sass'
tag: ${{ env.DART_SASS_VERSION }}
fileName: "dart-sass-${{ env.DART_SASS_VERSION }}-linux-x64.tar.gz"
extract: true
- name: Add Binary to PATH
run: |
sudo apt install ruby sass -y
echo "$GITHUB_WORKSPACE/dart-sass" >> "$GITHUB_PATH"
- name: Compile
run: |
cd ./src; make
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,26 @@ on:
tags:
- v*

env:
DART_SASS_VERSION: 1.79.6

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Dependencies
- name: Install Dart Sass
uses: robinraju/release-downloader@v1
with:
repository: 'sass/dart-sass'
tag: ${{ env.DART_SASS_VERSION }}
fileName: "dart-sass-${{ env.DART_SASS_VERSION }}-linux-x64.tar.gz"
extract: true
- name: Add Binary to PATH
run: |
sudo apt install ruby sass -y
- name: Compile
echo "$GITHUB_WORKSPACE/dart-sass" >> "$GITHUB_PATH"
- name: Compile
run: |
cd ./src; make all-and-compress
- name: Release
Expand Down
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ define build
mkdir -p $(target_dir)/$(1)-$(2)
mkdir -p $(target_dir)/$(1)-$(2)/target
if [ "$(3)" = "light" ]; then \
scss --sourcemap=none --style expanded $(working_dir)/headers/$(1)/$(3).scss $(target_dir)/$(1)-$(2)/target/latex.css; \
sass --no-source-map --style expanded $(working_dir)/headers/$(1)/$(3).scss $(target_dir)/$(1)-$(2)/target/latex.css; \
else \
scss --sourcemap=none --style expanded $(working_dir)/headers/$(1)/$(3).scss $(target_dir)/$(1)-$(2)/target/latex-$(3).css; \
sass --no-source-map --style expanded $(working_dir)/headers/$(1)/$(3).scss $(target_dir)/$(1)-$(2)/target/latex-$(3).css; \
fi
endef

Expand Down
35 changes: 20 additions & 15 deletions src/scss/settings.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
:root {
$ui-font: null;
$heading-Chinese-font: null;
$chapter-Chinese-font: null;
$sub-chapter-Chinese-font: null;
$sub-sub-chapter-Chinese-font: null;
@if $os == "windows" {
$ui-font: "\"阿里巴巴普惠体 2.0\"", "\"微软雅黑\"" !global;
$heading-Chinese-font: "华文黑体" !global;
$chapter-Chinese-font: "华文黑体" !global;
$sub-chapter-Chinese-font: "华文楷体" !global;
$sub-sub-chapter-Chinese-font: "华文仿宋" !global;
$ui-font: "\"阿里巴巴普惠体 2.0\"", "\"微软雅黑\"";
$heading-Chinese-font: "华文黑体";
$chapter-Chinese-font: "华文黑体";
$sub-chapter-Chinese-font: "华文楷体";
$sub-sub-chapter-Chinese-font: "华文仿宋";
} @else if $os == "macos" {
$ui-font: "\"苹方-简\"" !global;
$heading-Chinese-font: "华文黑体Bold" !global;
$chapter-Chinese-font: "方正公文黑体" !global;
$sub-chapter-Chinese-font: "方正公文楷体" !global;
$sub-sub-chapter-Chinese-font: "方正公文仿宋" !global;
$ui-font: "\"苹方-简\"";
$heading-Chinese-font: "华文黑体Bold";
$chapter-Chinese-font: "方正公文黑体";
$sub-chapter-Chinese-font: "方正公文楷体";
$sub-sub-chapter-Chinese-font: "方正公文仿宋";
} @else if $os == "linux" {
$ui-font: "\"Noto Sans CJK SC\"" !global;
$heading-Chinese-font: "Noto Sans CJK SC" !global;
$chapter-Chinese-font: "Noto Sans CJK SC" !global;
$sub-chapter-Chinese-font: "Noto Serif CJK SC" !global;
$sub-sub-chapter-Chinese-font: "Noto Serif CJK SC" !global;
$ui-font: "\"Noto Sans CJK SC\"";
$heading-Chinese-font: "Noto Sans CJK SC";
$chapter-Chinese-font: "Noto Sans CJK SC";
$sub-chapter-Chinese-font: "Noto Serif CJK SC";
$sub-sub-chapter-Chinese-font: "Noto Serif CJK SC";
}

/* == 字体设置 == */
Expand Down