From 656f733ba8379a65b8b19735245e0f4d8ae3790d Mon Sep 17 00:00:00 2001 From: Mao Zhou Date: Fri, 20 Sep 2024 15:04:18 +1000 Subject: [PATCH] test (#1) make CI works --- .github/workflows/CI.yml | 23 ++++++++++++----------- Project.toml | 2 +- config.toml | 12 ++++++------ contents/CSL_introduce.md | 1 - metadata.yml | 26 ++------------------------ src/CSL_Chinese.jl | 38 +++++++++++++++----------------------- 6 files changed, 36 insertions(+), 66 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 09c5f0e..863256c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,33 +3,34 @@ name: CI on: push: branches: - - master + - main pull_request: workflow_dispatch: jobs: BuildAndDeploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest + permissions: write-all steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: persist-credentials: false - - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/setup-julia@v2 with: - version: "1.6" + version: "1" - # 这里是用来安装 Books 必备的字体的,不能删除 - - name: Install dependencies - run: julia --color=yes --project -e 'using Pkg; Pkg.instantiate(); - using Books; Books.install_dependencies()' + - uses: julia-actions/cache@v2 - - run: julia --project -e 'using CSL_Chinese; using Books; mkpath("_build"); gen();' + - run: julia --color=yes --project -e 'using Pkg; Pkg.instantiate()' + + - run: julia --project -e 'using CSL_Chinese; CSL_Chinese.build()' - name: Deploy to gh-pages branch if: ${{ github.event_name != 'pull_request' }} - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: + cname: zmalt.github.io/CSL_Chinese github_token: ${{ secrets.GITHUB_TOKEN }} force_orphan: true publish_dir: ./_build/ diff --git a/Project.toml b/Project.toml index 1dfb286..f86982b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "CSL_Chinese" uuid = "2c2349b6-e3e1-473f-81d9-e9a98781fcdf" -authors = ["maozhou "] +authors = ["maozhou "] version = "0.1.0" [deps] diff --git a/config.toml b/config.toml index 7512a9a..2d96ac5 100644 --- a/config.toml +++ b/config.toml @@ -2,18 +2,18 @@ [projects.default] contents = [ + "index", "CSL_introduce", "XML_basis", "CSL_1.0.1_spec", - "locale_file" + "locale_file", ] + # Port used by serve() port = 8006 # Extra directories to be copied. - extra_directories = [ - "images" - ] + extra_directories = [] - online_url = "https://zmalt.github/io/csl" + online_url = "https://zmalt.github.io/CSL_Chinese" - output_filename = "CSL Chinese" + output_filename = "CSL_Chinese" diff --git a/contents/CSL_introduce.md b/contents/CSL_introduce.md index 7c140a0..7e23c3e 100644 --- a/contents/CSL_introduce.md +++ b/contents/CSL_introduce.md @@ -79,7 +79,6 @@ 要明白 CSL 是怎么运作的,首先要了解 CSL 的生态。`Style`指的是 CSL 样式,`Item Metadata`指的是每篇参考文献的作者,题目等信息,`Locale Files`是为实现与语言无关(指英语,汉语等)的格式的本地化文件,`Citation Details`指的是影响引文信息或参考文献列表表现的细节,比如顺序,位置等。 -![]() ### 独立格式和从属格式 diff --git a/metadata.yml b/metadata.yml index 6c75298..79861a7 100644 --- a/metadata.yml +++ b/metadata.yml @@ -1,33 +1,11 @@ --- -title: CSL Chinese +title: CSL_Chinese subtitle: "" author: - Mao Zhou -html-license: '' -pdf-footer: "" -tex-license: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International -lang: en-US -tags: [Julialang, CSL, Chinese] -repo: https://test +repo: secPrefix: Section -figPrefix: Figure -tblPrefix: Table -titlepage: true -bibliography: pandoc/references.bib allow-subsubsections: true -# Only used in PDF. -titlepage-top: > - \begin{tabular}{l} - Mao Zhou\\ - Wu Han University\\ - China\\ - \end{tabular} - -titlepage-bottom: | - First edition published 2021 - - \url{https://juliadatascience.io} - --- diff --git a/src/CSL_Chinese.jl b/src/CSL_Chinese.jl index 3d5aff8..7c1fa39 100644 --- a/src/CSL_Chinese.jl +++ b/src/CSL_Chinese.jl @@ -1,31 +1,23 @@ module CSL_Chinese +using Books using Reexport: @reexport -@reexport begin - using Books: - BUILD_DIR, - @sc, - @sco, - Options, - build_all, - catch_show, - clean_stacktrace, - code_block, - convert_output, - gen, - output_block, - sc, - sco, - scob, - serve, - without_caption_label - -end - -# Showcode additions. -export sce, scsob, trim_last_n_lines, plainblock +@reexport using Books: + build_all, html, pdf, + gen +""" + build() +This function is called during CI. +""" +function build() + # To avoid publishing broken websites. + fail_on_error = true + gen(; fail_on_error) + html() + #build_all(; fail_on_error) +end end # module