Skip to content

Commit

Permalink
feat: add linting ci (#15)
Browse files Browse the repository at this point in the history
This PR adds following:
- [x] Add prettier
- [x] Lint all files
- [x] Setup actions for linting & checking

Also, this PR introduced following changes
- PM changed to pnpm (see `package.json` for details`)

Co-authored-by: @Doublefire-Chen
  • Loading branch information
thezzisu authored Oct 30, 2024
1 parent 2317937 commit 4102b68
Show file tree
Hide file tree
Showing 21 changed files with 3,630 additions and 847 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Code Checks

on:
push:
branches: ['main']
pull_request:
branches: ['main']

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Install dependencies
run: corepack pnpm i

- name: Lint
run: corepack pnpm lint
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules
.vitepress/dist
.vitepress/cache
yarn.lock
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.17.0
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pnpm-lock.yaml
asserts
.vitepress/dist
5 changes: 5 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
singleQuote: true
semi: false
printWidth: 100
trailingComma: none
plugins: ['prettier-plugin-lint-md']
75 changes: 46 additions & 29 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { defineConfig } from 'vitepress'

export default defineConfig({
lang: "zh-CN",
title: "LCPU Getting Started",
description: "The Missing Semester refreshed by PKU Linux Club",
lang: 'zh-CN',
title: 'LCPU Getting Started',
description: 'The Missing Semester refreshed by PKU Linux Club',
lastUpdated: true,
cleanUrls: true,
srcExclude: [ 'README.md' ],
rewrites: {

},
srcExclude: ['README.md'],
rewrites: {},
markdown: {
container: {
tipLabel: '提示',
Expand All @@ -28,28 +26,47 @@ export default defineConfig({
text: '基础部分',
items: [
{ text: '01. 简介', link: '/basic/01-introduction' },
{ text: '02. 搜索和知识获取', link: '/basic/02-searching-and-question'},
{ text: '03. 计算机基本知识概览 I: 软硬件和操作系统', link: '/basic/03-computer-basic-knowledge-1'},
{ text: '04. 计算机基本知识概览 II: 计算机的评价', link: '/basic/04-computer-basic-knowledge-2'},
{ text: '05. 用好你的电脑 I: 环境配置,常用软件选择、安装与卸载', link: '/basic/05-drive-your-computer-1'},
{ text: '06. 用好你的电脑 II: 版本控制,Git和文件备份', link: '/basic/06-drive-your-computer-2'},
{ text: '07. 用好你的电脑 III: 小知识串讲,网络资源获取 ', link: '/basic/07-drive-your-computer-3'},
{ text: '08. 用好你的电脑 IV: 网络安全', link: '/basic/08-drive-your-computer-4'},
{ text: '09. 用好你的电脑 V: 操作系统和编程语言', link: '/basic/09-drive-your-computer-5'},
{ text: '10. Linux 基础知识:Linux 101', link: '/basic/10-linux-basic-1'},
{ text: '11. Linux 基础知识: 虚拟机安装和常用操作', link: '/basic/11-linux-basic-2'},
{ text: '12. 文本编辑: Markdown, LaTeX, Typst 和 Beamer', link: '/basic/12-text-editing'},
{ text: '02. 搜索和知识获取', link: '/basic/02-searching-and-question' },
{
text: '03. 计算机基本知识概览 I: 软硬件和操作系统',
link: '/basic/03-computer-basic-knowledge-1'
},
{
text: '04. 计算机基本知识概览 II: 计算机的评价',
link: '/basic/04-computer-basic-knowledge-2'
},
{
text: '05. 用好你的电脑 I: 环境配置,常用软件选择、安装与卸载',
link: '/basic/05-drive-your-computer-1'
},
{
text: '06. 用好你的电脑 II: 版本控制,Git和文件备份',
link: '/basic/06-drive-your-computer-2'
},
{
text: '07. 用好你的电脑 III: 小知识串讲,网络资源获取 ',
link: '/basic/07-drive-your-computer-3'
},
{ text: '08. 用好你的电脑 IV: 网络安全', link: '/basic/08-drive-your-computer-4' },
{
text: '09. 用好你的电脑 V: 操作系统和编程语言',
link: '/basic/09-drive-your-computer-5'
},
{ text: '10. Linux 基础知识:Linux 101', link: '/basic/10-linux-basic-1' },
{ text: '11. Linux 基础知识: 虚拟机安装和常用操作', link: '/basic/11-linux-basic-2' },
{
text: '12. 文本编辑: Markdown, LaTeX, Typst 和 Beamer',
link: '/basic/12-text-editing'
}
]
}
],
]
},
outline: {
label: '目录',
level: [2, 4],
level: [2, 4]
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/lcpu-club' }
],
socialLinks: [{ icon: 'github', link: 'https://github.com/lcpu-club' }],
footer: {
message: '由北京大学学生 Linux 俱乐部所著',
copyright: '© 2024 LCPU Club, licensed under CC BY-SA 4.0'
Expand All @@ -70,11 +87,11 @@ export default defineConfig({
pattern: 'https://github.com/lcpu-club/getting-started/edit/main/:path',
text: '在GitHub上更新本页'
},
darkModeSwitchLabel: "颜色选择",
lightModeSwitchTitle: "切换至亮色模式",
darkModeSwitchTitle: "切换至暗色模式",
sidebarMenuLabel: "目录",
returnToTopLabel: "回到顶部",
darkModeSwitchLabel: '颜色选择',
lightModeSwitchTitle: '切换至亮色模式',
darkModeSwitchTitle: '切换至暗色模式',
sidebarMenuLabel: '目录',
returnToTopLabel: '回到顶部',
externalLinkIcon: true,
search: {
provider: 'local',
Expand Down Expand Up @@ -105,6 +122,6 @@ export default defineConfig({
}
}
}
},
}
}
})
2 changes: 1 addition & 1 deletion .vitepress/theme/FeaturesTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
font-size: 24px;
}
}
</style>
</style>
18 changes: 9 additions & 9 deletions basic/01-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

我们将课程内容分为了入门、中级、进阶三大类。

+ 入门部分面向零基础同学,希望提供一个相对正确的学习路径,同时介绍基本的整个计算机的概念、体系,以及如何更加充分地使用计算机或其他设备。
+ 中级部分面向对计算机已有初步认识,并有兴趣深入了解的同学,较为全面地介绍 Linux 、软硬件知识以及部分工具的使用。
+ 进阶部分面向有一定技术基础的同学,拓宽同学们的技术视野,同时也为社团培养中坚力量,帮助感兴趣的同学更好地上手与参与社团项目共建。
- 入门部分面向零基础同学,希望提供一个相对正确的学习路径,同时介绍基本的整个计算机的概念、体系,以及如何更加充分地使用计算机或其他设备。
- 中级部分面向对计算机已有初步认识,并有兴趣深入了解的同学,较为全面地介绍 Linux 、软硬件知识以及部分工具的使用。
- 进阶部分面向有一定技术基础的同学,拓宽同学们的技术视野,同时也为社团培养中坚力量,帮助感兴趣的同学更好地上手与参与社团项目共建。

目前仅有入门篇初步完成了建设。欢迎感兴趣的同学与我们共建 wiki!

Expand All @@ -37,12 +37,12 @@

本部分主要分为五个板块。

+ 提问及知识获取,包含搜索引擎和大模型的使用,以及如何提问等内容。
+ 计算机知识概览,包含对于计算机软硬件及基本体系结构等的简要介绍。
+ 充分利用计算机,包含计算机的环境配置、文件版本控制、网络安全等多方面内容。
+ Linux 基础使用指南,包含虚拟机创建、环境配置以及部分常用操作等内容。
+ 文本编辑与写作工具,包含对于 Markdown, LaTeX, Typst, Beamer 等 pre 和论文写作时常用工具的介绍。
- 提问及知识获取,包含搜索引擎和大模型的使用,以及如何提问等内容。
- 计算机知识概览,包含对于计算机软硬件及基本体系结构等的简要介绍。
- 充分利用计算机,包含计算机的环境配置、文件版本控制、网络安全等多方面内容。
- Linux 基础使用指南,包含虚拟机创建、环境配置以及部分常用操作等内容。
- 文本编辑与写作工具,包含对于 Markdown, LaTeX, Typst, Beamer 等 pre 和论文写作时常用工具的介绍。

到此,如果你完整地学完了本部分的 wiki,你应该能对于计算机的基本概念有了一定的了解,从此计算机对你也不再是黑箱。当然,你对于大学期间所需要使用的最基本的技术与工具也应当不再陌生。更重要的是,你应当已经逐渐拥有了通过计算机**独立探索并解决问题**的能力。

那么,让我们开始吧!
那么,让我们开始吧!
Loading

0 comments on commit 4102b68

Please sign in to comment.