From bc77487395fa6ba61d5d01e1b8c30be2b3f9e03a Mon Sep 17 00:00:00 2001 From: magicWenli <48174882+magicwenli@users.noreply.github.com> Date: Sat, 29 Jun 2024 08:30:45 +0000 Subject: [PATCH 1/2] Use mdbook and github pages --- .github/workflows/deploy.yml | 29 +++++++++++++++++++ .gitignore | 1 + SUMMARY.md | 56 ++++++++++++++++++++++++++++++++++++ X.Solutions.md | 3 +- book.toml | 19 ++++++++++++ 5 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .gitignore create mode 100644 SUMMARY.md create mode 100644 book.toml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..f270056 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,29 @@ +name: GitHub Pages + +on: + push: + branches: + - master + pull_request: + +jobs: + deploy: + runs-on: ubuntu-20.04 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + steps: + - uses: actions/checkout@v2 + + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: 'latest' + + - run: mdbook build + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/main' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./book \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7585238 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +book diff --git a/SUMMARY.md b/SUMMARY.md new file mode 100644 index 0000000..12c26cb --- /dev/null +++ b/SUMMARY.md @@ -0,0 +1,56 @@ +# Summary + +- [译者序](README.md) + +# 目录 + +- [序](Foreword.md) +- [引言](Introduction.md) +- [I. 面试过程](I.The_Interview_Process.md) +- [II. 幕后](II.Behind_the_Scenes.md) +- [III. 特殊情况](III.Special_Situations.md) +- [IV. 面试之前](IV.Before_the_Interview.md) +- [V. 行为问题](V.Behavioral_Questions.md) +- [VI. Big O](VI.Big_O.md) +- [VII. 技术问题](VII.Technical_Questions.md) +- [VIII. Offer 及其他](VIII.The_Offer_and_Beyond.md) +- [IX. 面试问题](IX.Interview_Questions.md) + +# 数据结构 + +- [Chapter 1 I 数组和字符串](Chapter_1_Arrays_and_Strings.md) +- [Chapter 2 I 链表](Chapter_2_Linked_Lists.md) +- [Chapter 3 I 栈和队列](Chapter_3_Stacks_and_Queues.md) +- [Chapter 4 I 树和图](Chapter_4_Trees_and_Graphs.md) + +# 概念和算法 + +- [Chapter 5 I 位操作](Chapter_5_Bit_Manipulation.md) +- [Chapter 6 I 数学和逻辑难题](Chapter_6_Math_and_Logic_Puzzles.md) +- [Chapter 7 I 面向对象的设计](Chapter_7_Object-Oriented_Design.md) +- [Chapter 8 I 递归和动态规划](Chapter_8_Recursion_and_Dynamic_Programming.md) +- [Chapter 9 I 系统设计和可扩展性](Chapter_9_System_Design_and_Scalability.md) +- [Chapter 10 I 排序与搜索](Chapter_10_Sorting_and_Searching.md) +- [Chapter 11 I 测试](Chapter_11_Testing.md) + +# 基础知识 + +- [Chapter 12 I C 和 C++](Chapter_12_C_and_C++.md) +- [Chapter 13 I Java](Chapter_13_Java.md) +- [Chapter 14 I 数据库](Chapter_14_Databases.md) +- [Chapter 15 I 线程和锁](Chapter_15_Threads_and_Locks.md) + +# 附加复习题 + +- [Chapter 16 I 中等](Chapter_16_Moderate.md) +- [Chapter 17 I 困难](Chapter_17_Hard.md) + +--- + +- [X. 答案](X.Solutions.md) +- [XI. 进阶主题]() + +- [XII. 代码库](XII.Code_Library.md) +- [XIII. 提示]() + +- [XIV. 关于作者](XIV.About_the_Author.md) \ No newline at end of file diff --git a/X.Solutions.md b/X.Solutions.md index e112be4..12735a8 100644 --- a/X.Solutions.md +++ b/X.Solutions.md @@ -1,2 +1,3 @@ -# X. 解决方法 +# X. 答案 +注:本书的 `X. 答案` 部分为编码答案,本项目中不做翻译收录,需要阅读的同学可以阅读英文原版,或者 *CareerCup* 的这个项目:[https://github.com/careercup/CtCI-6th-Edition](https://github.com/careercup/CtCI-6th-Edition) 。 \ No newline at end of file diff --git a/book.toml b/book.toml new file mode 100644 index 0000000..ce70615 --- /dev/null +++ b/book.toml @@ -0,0 +1,19 @@ +[book] +authors = ["F8F-1BearCat"] +language = "cn" +multilingual = false +src = "./" +title = "CtCI-6th-Edition-CN" + +[output.html] +git-repository-url = "https://github.com/magicwenli/CtCI-6th-Edition-CN/tree/master" +edit-url-template = "https://github.com/magicwenli/CtCI-6th-Edition-CN/edit/master/{path}" + +[output.html.search] +limit-results = 20 +use-boolean-and = true +boost-title = 2 +boost-hierarchy = 2 +boost-paragraph = 1 +expand = true +heading-split-level = 2 \ No newline at end of file From 9fa055e3b0b3205828e80d45c6f53005434792b7 Mon Sep 17 00:00:00 2001 From: magicWenli <48174882+magicwenli@users.noreply.github.com> Date: Sat, 29 Jun 2024 08:35:21 +0000 Subject: [PATCH 2/2] Update workflows actions --- .github/workflows/deploy.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f270056..04f8f88 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,22 +8,22 @@ on: jobs: deploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest concurrency: group: ${{ github.workflow }}-${{ github.ref }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup mdBook - uses: peaceiris/actions-mdbook@v1 + uses: peaceiris/actions-mdbook@v2 with: mdbook-version: 'latest' - run: mdbook build - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.ref == 'refs/heads/main' }} + uses: peaceiris/actions-gh-pages@v4 + if: ${{ github.ref == 'refs/heads/master' }} with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./book \ No newline at end of file