From 2287a0dceeb38f2ab73f96f4871d3d013fe626cc Mon Sep 17 00:00:00 2001 From: IsshikiHugh Date: Fri, 9 Aug 2024 23:32:07 -0500 Subject: [PATCH] feat: initialization --- .base_commit | 1 + .gitattributes | 6 + .github/workflows/ci.yaml | 38 +++ .gitignore | 14 + LICENSE | 437 ++++++++++++++++++++++++++++++ README.md | 13 + docs/0-x.md | 67 +++++ docs/imgs/ZIJI-LOGO.png | 0 docs/index.md | 12 + docs/supports/css/admonitions.css | 214 +++++++++++++++ docs/supports/css/base.css | 19 ++ docs/supports/css/theme.css | 116 ++++++++ docs/supports/js/katex.js | 38 +++ docs/supports/js/xlink.js | 17 ++ mkdocs.yaml | 99 +++++++ overrides/partials/comments.html | 37 +++ requirements.txt | 42 +++ scripts/init.sh | 36 +++ scripts/sync_base.sh | 57 ++++ 19 files changed, 1263 insertions(+) create mode 100644 .base_commit create mode 100644 .gitattributes create mode 100644 .github/workflows/ci.yaml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 docs/0-x.md create mode 100644 docs/imgs/ZIJI-LOGO.png create mode 100644 docs/index.md create mode 100644 docs/supports/css/admonitions.css create mode 100644 docs/supports/css/base.css create mode 100644 docs/supports/css/theme.css create mode 100644 docs/supports/js/katex.js create mode 100644 docs/supports/js/xlink.js create mode 100644 mkdocs.yaml create mode 100644 overrides/partials/comments.html create mode 100644 requirements.txt create mode 100755 scripts/init.sh create mode 100755 scripts/sync_base.sh diff --git a/.base_commit b/.base_commit new file mode 100644 index 0000000..c9ee8d8 --- /dev/null +++ b/.base_commit @@ -0,0 +1 @@ +4357ef5d84f5fbb3ce8df4274e592de53b72d59d \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b534107 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +# Help GitHub identify the language of your files +*.md linguist-language=Markdown linguist-vendored=false linguist-documentation=false linguist-detectable=true +*.css linguist-language=CSS linguist-vendored=false linguist-documentation=false linguist-detectable=true +*.js linguist-language=JavaScript linguist-vendored=false linguist-documentation=false linguist-detectable=true +*.yml linguist-language=YAML linguist-vendored=false linguist-documentation=false linguist-detectable=true +* text=auto eol=lf \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..c845093 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,38 @@ +name: ci +on: + push: + branches: + - main +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email actions@github.com + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + fetch-depth: 0 + + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v3 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + + - name: Solve Dependencies + run: pip install -r requirements.txt + + - name: Build + run: mkdocs gh-deploy --force diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c758639 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# Editors Files +.vscode +.idea + +# Desktop Services Store +.DS_Store + +# Static Files +site + +# Automation Supports +.trash +.base_repo +sync_patch.patch \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..cbe5ad1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,437 @@ +Attribution-NonCommercial-ShareAlike 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International +Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution-NonCommercial-ShareAlike 4.0 International Public License +("Public License"). To the extent this Public License may be +interpreted as a contract, You are granted the Licensed Rights in +consideration of Your acceptance of these terms and conditions, and the +Licensor grants You such rights in consideration of benefits the +Licensor receives from making the Licensed Material available under +these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. BY-NC-SA Compatible License means a license listed at + creativecommons.org/compatiblelicenses, approved by Creative + Commons as essentially the equivalent of this Public License. + + d. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + e. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + f. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + g. License Elements means the license attributes listed in the name + of a Creative Commons Public License. The License Elements of this + Public License are Attribution, NonCommercial, and ShareAlike. + + h. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + i. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + j. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + k. NonCommercial means not primarily intended for or directed towards + commercial advantage or monetary compensation. For purposes of + this Public License, the exchange of the Licensed Material for + other material subject to Copyright and Similar Rights by digital + file-sharing or similar means is NonCommercial provided there is + no payment of monetary compensation in connection with the + exchange. + + l. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + m. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + n. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part, for NonCommercial purposes only; and + + b. produce, reproduce, and Share Adapted Material for + NonCommercial purposes only. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. Additional offer from the Licensor -- Adapted Material. + Every recipient of Adapted Material from You + automatically receives an offer from the Licensor to + exercise the Licensed Rights in the Adapted Material + under the conditions of the Adapter's License You apply. + + c. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties, including when + the Licensed Material is used other than for NonCommercial + purposes. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + b. ShareAlike. + + In addition to the conditions in Section 3(a), if You Share + Adapted Material You produce, the following conditions also apply. + + 1. The Adapter's License You apply must be a Creative Commons + license with the same License Elements, this version or + later, or a BY-NC-SA Compatible License. + + 2. You must include the text of, or the URI or hyperlink to, the + Adapter's License You apply. You may satisfy this condition + in any reasonable manner based on the medium, means, and + context in which You Share Adapted Material. + + 3. You may not offer or impose any additional or different terms + or conditions on, or apply any Effective Technological + Measures to, Adapted Material that restrict exercise of the + rights granted under the Adapter's License You apply. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database for NonCommercial purposes + only; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material, + including for purposes of Section 3(b); and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/README.md b/README.md new file mode 100644 index 0000000..35b011b --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# ZIJI-CS + +请访问 **About** 中的 URL 来访问网页。 + +如果遇到公式渲染等问题,请尝试切换到更科学的网络环境再做尝试。 + +## 关于贡献 + +如果您有任何关于本项目的建议或意见,又或者是想维护新的课程资源,请考虑提交 Issue 或参考[本页](https://ziji-cs.github.io/contribution/)了解贡献方式! + +## 许可 + +本仓库中的内容使用 [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh) 进行许可。 \ No newline at end of file diff --git a/docs/0-x.md b/docs/0-x.md new file mode 100644 index 0000000..fd1a411 --- /dev/null +++ b/docs/0-x.md @@ -0,0 +1,67 @@ +# 0.x 导论 + +!!! info "前言" + + ... + + +???+ section inline end "扩展项" + + + === "Tab 1" + + - [x] 目标 1 + - [ ] 目标 2 + - [ ] 目标 3 + + ===+ "Tab 2" + + + - [x] 目标 1 + - [x] 目标 2 + - [ ] 目标 3 + + === "Tab 3" + + - [x] 目标 1 + - [x] 目标 2 + - [x] 目标 3 + + + +## 正文 + +- **加粗** +- *斜体* +- [URL](./0-x.md) +- 上^标^ +- ==高亮== +- ~~删除~~ + +### 公式块 + +$$ +\left\{ + \begin{aligned} + x &= \cos(\theta) \\ + y &= \sin(\theta) \\ + \end{aligned} +\right. +$$ + +$$ +S^2=\frac{1}{n-1}\sum_{i=1}^{n}(X_i-\overline{X})^2 +$$ + +- 行内公式:$\sum_{i=0}^n N_i$ + +### 代码块 + +```python title="Code Blocks" linenums="1" hl_lines="4" +#!/usr/bin/env python3 + +if __name__ == "__main__": + print("Hello ZIJI-CS!") +``` + +- `#!python print("行内代码高亮")` diff --git a/docs/imgs/ZIJI-LOGO.png b/docs/imgs/ZIJI-LOGO.png new file mode 100644 index 0000000..e69de29 diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..a532a7c --- /dev/null +++ b/docs/index.md @@ -0,0 +1,12 @@ +# <课程名称> + +!!! info "课程基本信息" + + - 课程名称:<课程名称> + - 课程代码:`` + - 授课老师:<0>、<1>、<2> + +!!! section "资源目录" + + - [0.x 导论](0-x.md) + - ... \ No newline at end of file diff --git a/docs/supports/css/admonitions.css b/docs/supports/css/admonitions.css new file mode 100644 index 0000000..8a8ac19 --- /dev/null +++ b/docs/supports/css/admonitions.css @@ -0,0 +1,214 @@ + +/* Customized admonitions: https://squidfunk.github.io/mkdocs-material/reference/admonitions/#customization */ + +/* definition */ + +:root { + --md-admonition-icon--definition: url('data:image/svg+xml;charset=utf-8,') +} + +.md-typeset .admonition.definition, +.md-typeset details.definition { + border-color: #d2b300; +} + +.md-typeset .definition>.admonition-title, +.md-typeset .definition>summary { + background-color: #fbffde; +} + +.md-typeset .definition>.admonition-title::before, +.md-typeset .definition>summary::before { + background-color: #d2b300; + -webkit-mask-image: var(--md-admonition-icon--definition); + mask-image: var(--md-admonition-icon--definition); +} + +/* proof */ + +:root { + --md-admonition-icon--proof: url('data:image/svg+xml;charset=utf-8,') +} + +.md-typeset .admonition.proof, +.md-typeset details.proof { + border-color: #d8d0aa; +} + +.md-typeset .proof>.admonition-title, +.md-typeset .proof>summary { + background-color: #fdfdec; +} + +.md-typeset .proof>.admonition-title::before, +.md-typeset .proof>summary::before { + background-color: #d8d0aa; + -webkit-mask-image: var(--md-admonition-icon--proof); + mask-image: var(--md-admonition-icon--proof); +} + + +/* property */ + +:root { + --md-admonition-icon--property: url('data:image/svg+xml;charset=utf-8,') +} + +.md-typeset .admonition.property, +.md-typeset details.property { + border-color: #aaccd8; +} + +.md-typeset .property>.admonition-title, +.md-typeset .property>summary { + background-color: #ecf8fd; +} + +.md-typeset .property>.admonition-title::before, +.md-typeset .property>summary::before { + background-color: #aaccd8; + -webkit-mask-image: var(--md-admonition-icon--property); + mask-image: var(--md-admonition-icon--property); +} + +/* extra */ + +:root { + --md-admonition-icon--extra: url('data:image/svg+xml;charset=utf-8,') +} + +.md-typeset .admonition.extra, +.md-typeset details.extra { + border-color: #D09CFA; +} + +.md-typeset .extra>.admonition-title, +.md-typeset .extra>summary { + background-color: #F7DDFF; +} + +.md-typeset .extra>.admonition-title::before, +.md-typeset .extra>summary::before { + background-color: #D09CFA; + -webkit-mask-image: var(--md-admonition-icon--extra); + mask-image: var(--md-admonition-icon--extra); +} + + +/* section */ + +:root { + --md-admonition-icon--section: url('data:image/svg+xml;charset=utf-8,') +} + +.md-typeset .admonition.section, +.md-typeset details.section { + border-color: #3AB4F2; +} + +.md-typeset .section>.admonition-title, +.md-typeset .section>summary { + background-color: #e1e8ff; +} + +.md-typeset .section>.admonition-title::before, +.md-typeset .section>summary::before { + background-color: #3AB4F2; + -webkit-mask-image: var(--md-admonition-icon--section); + mask-image: var(--md-admonition-icon--section); +} + + +/* key-point */ + +:root { + --md-admonition-icon--key-point: url('data:image/svg+xml;charset=utf-8,') +} + +.md-typeset .admonition.key-point, +.md-typeset details.key-point { + border-color: #FF884B; +} + +.md-typeset .key-point>.admonition-title, +.md-typeset .key-point>summary { + background-color: #fff0c7; +} + +.md-typeset .key-point>.admonition-title::before, +.md-typeset .key-point>summary::before { + background-color: #FF884B; + -webkit-mask-image: var(--md-admonition-icon--key-point); + mask-image: var(--md-admonition-icon--key-point); +} + +/* advice */ + +:root { + --md-admonition-icon--advice: url('data:image/svg+xml;charset=utf-8,') +} + +.md-typeset .admonition.advice, +.md-typeset details.advice { + border-color: #acc1a0; +} + +.md-typeset .advice>.admonition-title, +.md-typeset .advice>summary { + background-color: #ddf7d7; +} + +.md-typeset .advice>.admonition-title::before, +.md-typeset .advice>summary::before { + background-color: #acc1a0; + -webkit-mask-image: var(--md-admonition-icon--advice); + mask-image: var(--md-admonition-icon--advice); +} + + +/* not-advice */ + +:root { + --md-admonition-icon--not-advice: url('data:image/svg+xml;charset=utf-8,') +} + +.md-typeset .admonition.not-advice, +.md-typeset details.not-advice { + border-color: #b46060; +} + +.md-typeset .not-advice>.admonition-title, +.md-typeset .not-advice>summary { + background-color: #ffe2d1; +} + +.md-typeset .not-advice>.admonition-title::before, +.md-typeset .not-advice>summary::before { + background-color: #b46060; + -webkit-mask-image: var(--md-admonition-icon--not-advice); + mask-image: var(--md-admonition-icon--not-advice); +} + + +/* eg */ + +:root { + --md-admonition-icon--eg: url('data:image/svg+xml;charset=utf-8,') +} + +.md-typeset .admonition.eg, +.md-typeset details.eg { + border-color: #B7CADB; +} + +.md-typeset .eg>.admonition-title, +.md-typeset .eg>summary { + background-color: #FDF6EC; +} + +.md-typeset .eg>.admonition-title::before, +.md-typeset .eg>summary::before { + background-color: #B7CADB; + -webkit-mask-image: var(--md-admonition-icon--eg); + mask-image: var(--md-admonition-icon--eg); +} diff --git a/docs/supports/css/base.css b/docs/supports/css/base.css new file mode 100644 index 0000000..1a610b4 --- /dev/null +++ b/docs/supports/css/base.css @@ -0,0 +1,19 @@ +/* Highlight title settings. */ + +h2::before, h3::before, h4::before { + content: "# "; +} + +.md-typeset h1, .md-typeset h2, .md-typeset h3, .md-typeset h4, .md-typeset h5 { + font-weight: 600; +} + +/* Admonition settings. */ + +.md-typeset .admonition, .md-typeset details { + border: none; +} + +.md-typeset .admonition, .md-typeset details { + font-size: inherit; +} diff --git a/docs/supports/css/theme.css b/docs/supports/css/theme.css new file mode 100644 index 0000000..f551128 --- /dev/null +++ b/docs/supports/css/theme.css @@ -0,0 +1,116 @@ + +:root { + --md-primary-fg-color: #20488C; + --md-primary-fg-color--light: #20488C; + --md-primary-fg-color--dark: #20488C; + --md-primary-bg-color: #f4f8ff; + --md-primary-bg-color--light: #e8f0ff; + --md-accent-fg-color: #3881CE; + --md-accent-fg-color--transparent: #526cfe1a; + --md-accent-bg-color: #f4f8ff; + --md-accent-bg-color--light: #e8f0ff; +} + +:root, [data-md-color-scheme=default] { + --md-hue: 225deg; + --md-default-fg-color: #000000de; + --md-default-fg-color--light: #0000008a; + --md-default-fg-color--lighter: #00000052; + --md-default-fg-color--lightest: #00000012; + --md-default-bg-color: #ffffff; + --md-default-bg-color--light: #ffffffb3; + --md-default-bg-color--lighter: #ffffff4d; + --md-default-bg-color--lightest: #ffffff1f; + --md-code-fg-color: #36464e; + --md-code-bg-color: #f5f5f5; + --md-code-hl-color: #4287ff; + --md-code-hl-color--light: #4287ff1a; + --md-code-hl-number-color: #d52a2a; + --md-code-hl-special-color: #db1457; + --md-code-hl-function-color: #a846b9; + --md-code-hl-constant-color: #6e59d9; + --md-code-hl-keyword-color: #3f6ec6; + --md-code-hl-string-color: #1c7d4d; + --md-code-hl-name-color: var(--md-code-fg-color); + --md-code-hl-operator-color: var(--md-default-fg-color--light); + --md-code-hl-punctuation-color: var(--md-default-fg-color--light); + --md-code-hl-comment-color: var(--md-default-fg-color--light); + --md-code-hl-generic-color: var(--md-default-fg-color--light); + --md-code-hl-variable-color: var(--md-default-fg-color--light); + --md-typeset-color: var(--md-default-fg-color); + --md-typeset-a-color: var(--md-primary-fg-color); + --md-typeset-del-color: #f5503d26; + --md-typeset-ins-color: #0bd57026; + --md-typeset-kbd-color: #fafafa; + --md-typeset-kbd-accent-color: #fff; + --md-typeset-kbd-border-color: #b8b8b8; + --md-typeset-mark-color: #ffff0080; + --md-typeset-table-color: #0000001f; + --md-typeset-table-color--light: rgba(0,0,0,.035); + --md-admonition-fg-color: var(--md-default-fg-color); + --md-admonition-bg-color: var(--md-default-bg-color); + --md-warning-fg-color: #000000de; + --md-warning-bg-color: #ff9; + --md-footer-fg-color: #fff; + --md-footer-fg-color--light: #ffffffb3; + --md-footer-fg-color--lighter: #ffffff73; + --md-footer-bg-color: #000000de; + --md-footer-bg-color--dark: #00000052; + --md-shadow-z1: 0 0.2rem 0.5rem #0000000d,0 0 0.05rem #0000001a; + --md-shadow-z2: 0 0.2rem 0.5rem #0000001a,0 0 0.05rem #00000040; + --md-shadow-z3: 0 0.2rem 0.5rem #0003,0 0 0.05rem #00000059; +} + +:root, [data-md-color-scheme=dark] { + --md-hue: 225deg; + --md-default-fg-color: #000000de; + --md-default-fg-color--light: #0000008a; + --md-default-fg-color--lighter: #00000052; + --md-default-fg-color--lightest: #00000012; + --md-default-bg-color: #ffffff; + --md-default-bg-color--light: #ffffffb3; + --md-default-bg-color--lighter: #ffffff4d; + --md-default-bg-color--lightest: #ffffff1f; + --md-code-fg-color: #36464e; + --md-code-bg-color: #f5f5f5; + --md-code-hl-color: #4287ff; + --md-code-hl-color--light: #4287ff1a; + --md-code-hl-number-color: #d52a2a; + --md-code-hl-special-color: #db1457; + --md-code-hl-function-color: #a846b9; + --md-code-hl-constant-color: #6e59d9; + --md-code-hl-keyword-color: #3f6ec6; + --md-code-hl-string-color: #1c7d4d; + --md-code-hl-name-color: var(--md-code-fg-color); + --md-code-hl-operator-color: var(--md-default-fg-color--light); + --md-code-hl-punctuation-color: var(--md-default-fg-color--light); + --md-code-hl-comment-color: var(--md-default-fg-color--light); + --md-code-hl-generic-color: var(--md-default-fg-color--light); + --md-code-hl-variable-color: var(--md-default-fg-color--light); + --md-typeset-color: var(--md-default-fg-color); + --md-typeset-a-color: var(--md-primary-fg-color); + --md-typeset-del-color: #f5503d26; + --md-typeset-ins-color: #0bd57026; + --md-typeset-kbd-color: #fafafa; + --md-typeset-kbd-accent-color: #fff; + --md-typeset-kbd-border-color: #b8b8b8; + --md-typeset-mark-color: #ffff0080; + --md-typeset-table-color: #0000001f; + --md-typeset-table-color--light: rgba(0,0,0,.035); + --md-admonition-fg-color: var(--md-default-fg-color); + --md-admonition-bg-color: var(--md-default-bg-color); + --md-warning-fg-color: #000000de; + --md-warning-bg-color: #ff9; + --md-footer-fg-color: #fff; + --md-footer-fg-color--light: #ffffffb3; + --md-footer-fg-color--lighter: #ffffff73; + --md-footer-bg-color: #000000de; + --md-footer-bg-color--dark: #00000052; + --md-shadow-z1: 0 0.2rem 0.5rem #0000000d,0 0 0.05rem #0000001a; + --md-shadow-z2: 0 0.2rem 0.5rem #0000001a,0 0 0.05rem #00000040; + --md-shadow-z3: 0 0.2rem 0.5rem #0003,0 0 0.05rem #00000059; +} + +::selection { + background:#20488C9c; +} \ No newline at end of file diff --git a/docs/supports/js/katex.js b/docs/supports/js/katex.js new file mode 100644 index 0000000..056f1ef --- /dev/null +++ b/docs/supports/js/katex.js @@ -0,0 +1,38 @@ +(function () { + 'use strict'; + + var katexMath = (function () { + var maths = document.querySelectorAll('.arithmatex'), + tex; + + for (var i = 0; i < maths.length; i++) { + tex = maths[i].textContent || maths[i].innerText; + if (tex.startsWith('\\(') && tex.endsWith('\\)')) { + katex.render(tex.slice(2, -2), maths[i], {'displayMode': false}); + } else if (tex.startsWith('\\[') && tex.endsWith('\\]')) { + katex.render(tex.slice(2, -2), maths[i], {'displayMode': true}); + } + } + }); + + (function () { + var onReady = function onReady(fn) { + if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", fn); + } else { + document.attachEvent("onreadystatechange", function () { + if (document.readyState === "interactive") { + fn(); + } + }); + } + }; + + onReady(function () { + if (typeof katex !== "undefined") { + katexMath(); + } + }); + })(); + + }()); \ No newline at end of file diff --git a/docs/supports/js/xlink.js b/docs/supports/js/xlink.js new file mode 100644 index 0000000..dc49265 --- /dev/null +++ b/docs/supports/js/xlink.js @@ -0,0 +1,17 @@ +(function (document) { + + // open external link in new tab + function external_new_tab() { + for (let menu = document.getElementsByTagName("a"), cnt = 0; cnt < menu.length; cnt++) { + let temp = menu[cnt]; + if (temp.getAttribute("href") && temp.hostname !== location.hostname) { + temp.target = "_blank"; + } + } + } + + if (typeof document !== "undefined") { + external_new_tab(); + } + +})(document); diff --git a/mkdocs.yaml b/mkdocs.yaml new file mode 100644 index 0000000..4ed16ad --- /dev/null +++ b/mkdocs.yaml @@ -0,0 +1,99 @@ +site_name: ZIJI-CS-<课程名称> # TODO: 请修改项配置,将尖括号内的内容替换为课程名称 +repo_name: ZIJI-CS/F-MkDocs-Template # TODO: 请修改项配置,将其设置为对应的仓库 +repo_url: https://github.com/ZIJI-CS/F-MkDocs-Template # TODO: 请修改项配置,将其设置为对应的仓库的 URL,一般替换后缀即可 +edit_uri: blob/main/docs + +copyright: 'Copyright © 2024 ZIJI-CS' # TODO: 请修改项配置,主要就是年份,对的就不用管 + +theme: + name: material + language: zh + features: + - navigation.tabs + - navigation.indexes + - navigation.expand + - navigation.top + - search.highlight + - search.share + - content.action.edit + - content.action.view + - content.code.annotate + - content.code.copy + icon: + repo: fontawesome/brands/github-alt + edit: material/pencil + view: material/eye + # custom_dir: overrides # TODO: 请根据指导配置完 Giscus 后再取消注释:https://squidfunk.github.io/mkdocs-material/setup/adding-a-comment-system/ + +markdown_extensions: + - toc: + permalink: true + slugify: !!python/object/apply:pymdownx.slugs.slugify {kwds: {case: lower}} + - admonition + - pymdownx.details + - attr_list + - footnotes + - md_in_html + - tables + - pymdownx.caret + - pymdownx.mark + - pymdownx.tilde + - pymdownx.highlight + - pymdownx.inlinehilite + - pymdownx.arithmatex: + generic: true + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format + - pymdownx.tabbed: + alternate_style: true + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + +plugins: + - git-revision-date-localized: + type: datetime + timezone: Asia/Shanghai + locale: zh + enable_creation_date: true + - search: + separator: '[\s\-\.]+' + - git-committers: + repository: ZIJI-CS/F-MkDocs-Template # TODO: 请修改本项配置,一般同步于 repo_name 即可(如果主分支不叫 main 也请修改 branch 项) + branch: main + - statistics: + words_per_minute: 200 + - glightbox + +extra_css: + # 如果需要修改主题样式,可以修改 `theme.css`;如果需要修改 admonitions 的主题,可以修改 `admonitions.css` + - supports/css/base.css + - supports/css/theme.css + - supports/css/admonitions.css + # 如果公式渲染样式出现问题,请检查如下脚本 + - https://jsd.cdn.zzko.cn/npm/katex@0.16.4/dist/katex.min.css + +extra_javascript: + # 自动令所有第三方链接在新标签页中打开 + - supports/js/xlink.js + # 如果公式渲染出现问题,请检查如下脚本 + - supports/js/katex.js + - https://jsd.cdn.zzko.cn/npm/katex@0.16.4/dist/katex.min.js + +# ======================================== >>> +# TODO: 请修改本项配置,本节是导航配置项,一般只需要在下面增加新的章节对应的文件即可,支持结构化配置 + +nav: + - "Home": "https://ziji-cs.github.io/" + - "Main": + - index.md + - 0-x.md + # - "Appendix": + +# ======================================== <<< + diff --git a/overrides/partials/comments.html b/overrides/partials/comments.html new file mode 100644 index 0000000..4b1799c --- /dev/null +++ b/overrides/partials/comments.html @@ -0,0 +1,37 @@ +{% if page.meta.comments != false %} +

{{ lang.t("meta.comments") }}

+ + + + + + + +{% endif %} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..8c1e612 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,42 @@ +Babel==2.14.0 +certifi==2024.7.4 +charset-normalizer==3.3.2 +click==8.1.7 +colorama==0.4.6 +csscompressor==0.9.5 +ghp-import==2.1.0 +gitdb==4.0.11 +GitPython==3.1.41 +htmlmin2==0.1.13 +idna==3.7 +Jinja2==3.1.4 +jsmin==3.0.1 +Markdown==3.5.2 +MarkupSafe==2.1.4 +mergedeep==1.3.4 +mkdocs==1.6.0 +mkdocs-get-deps==0.2.0 +mkdocs-git-committers-plugin-2==2.3.0 +mkdocs-git-revision-date-localized-plugin==1.2.6 +mkdocs-glightbox==0.4.0 +mkdocs-material==9.5.31 +mkdocs-material-extensions==1.3.1 +mkdocs-minify-plugin==0.8.0 +mkdocs-statistics-plugin==0.1.2 +packaging==23.2 +paginate==0.5.6 +pathspec==0.12.1 +platformdirs==4.1.0 +Pygments==2.17.2 +pymdown-extensions==10.7 +python-dateutil==2.8.2 +python-markdown-math==0.8 +pytz==2023.3.post1 +PyYAML==6.0.1 +pyyaml_env_tag==0.1 +regex==2023.12.25 +requests==2.32.3 +six==1.16.0 +smmap==5.0.1 +urllib3==2.2.2 +watchdog==3.0.0 diff --git a/scripts/init.sh b/scripts/init.sh new file mode 100755 index 0000000..cf3795f --- /dev/null +++ b/scripts/init.sh @@ -0,0 +1,36 @@ +#! /bin/bash + +# Store current position. +curDir=`pwd` +# Switch to working position, which is the root of the project. +workDir=$(cd "$(dirname "$0")/..";pwd) +cd $workDir + +# ====== + +# Step 1: note down the base commit. +git log -1 --pretty=format:"%H" > .base_commit + +# Step 2: remove useless folder. +mkdir -p .trash # this file is used to store the trash files. +mv .cache .trash/dot_cache +mv .git .trash/dot_git +echo "[1/2] The \`.cache\` and \`.git\` folders are moved into the \`.trash\` folder. Delete the \`.trash\` folder yourself to confirm no important data are dropped." +echo "[1/2] 已将 \`.cache\` 和 \`.git\` 文件夹丢弃至 \`.trash\` 文件夹,请手动删除 \`.trash\` 文件夹以确认没有重要数据被丢弃。" + +# Step 1: initialize the git repository. +git init . +git add -A +git commit -m "feat: initialization" +echo "[2/2] Already initialized the git repository. Bind the remote repository and push to the remote yourself." +echo "[2/2] 已完成对本地 git 仓库的初始化,请手动绑定远程仓库。" + +echo "There are still several steps to finish the initialization. Check the link below for further instruction!" +echo "https://ziji-cs.github.io/contribution/#初始化" +echo "在完成初始化之前,你还有一些步骤需要完成。请参考下方链接。" +echo "https://ziji-cs.github.io/contribution/#初始化" + +# ====== + +# Recover the current position. +cd $curDir \ No newline at end of file diff --git a/scripts/sync_base.sh b/scripts/sync_base.sh new file mode 100755 index 0000000..a73f5e1 --- /dev/null +++ b/scripts/sync_base.sh @@ -0,0 +1,57 @@ +#! /bin/bash + +# Store current position. +curDir=`pwd` +# Switch to working position, which is the root of the project. +workDir=$(cd "$(dirname "$0")/..";pwd) +cd $workDir + +# ====== + +# Step 1: clone base repository. +if [ ! -d ".base_repo" ]; then + git clone https://github.com/ZIJI-CS/F-MkDocs-Template.git .base_repo +fi + +# Step 2: before syncing, storage changes not committed. +if [ -n "$(git status --porcelain)" ]; then + echo "There are uncommitted changes in the current repository. Please commit or stash these changes first!" + echo "当前仓库存在未提交的更改,请先提交或者存储这些更改!" + exit 0 +fi + +# Step 3: update the base repository. +baseCommitHash=`cat .base_commit` +cd .base_repo +git pull # update the base repository, in case the base repository has been updated + +# Step 4: check if it is up-to-date, if not, cache the latest commit hash. +if [ "$baseCommitHash" = "$(git log -1 --pretty=format:%H)" ]; then + echo "The base repository is up-to-date. No need to sync!" + echo "基础仓库已经是最新的,无需同步!" + exit 0 +fi +git log -1 --pretty=format:%H > ../.base_commit_latest + +# Step 5: generate the patch. +git format-patch --stdout $baseCommitHash..HEAD -- ":(exclude).cache" > sync_patch.patch + +# Step 6: apply patches to the current repository. +cd .. +if ! git apply --reject --whitespace=fix .base_repo/sync_patch.patch; then + echo "Failed to apply patches. Please check the conflict files and resolve them manually!" + echo "无法应用补丁,请检查冲突文件并手动解决!" + exit 0 +fi + +# Step 7: update the commit hash. +mv .base_commit_latest .base_commit + +# Step 8: commit the changes. +git add -A +git commit -m "update: sync base repository" + +# ====== + +# Recover the current position. +cd $curDir \ No newline at end of file