Skip to content

Commit

Permalink
Merge pull request #15 from zhangzhuang15/dev
Browse files Browse the repository at this point in the history
add intro of vscode, its config, its plugins and its tasks.json;
  • Loading branch information
zhangzhuang15 authored Jan 14, 2024
2 parents 678a774 + d9d02c2 commit dfce06f
Show file tree
Hide file tree
Showing 43 changed files with 1,630 additions and 50 deletions.
74 changes: 66 additions & 8 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,24 @@ export default defineConfig({
},
// index.md 将被特殊处理,其路由是 /blog/ 而不是 /blog/index,
// 这会影响到sidebar的高亮问题,因此重命名为index-page;
//
// important 命名成 page-index 也影响到sidebar的高亮显示,
// 避免以 index 结尾吧!
//
// activeMatch必须存在,否则,阅读“首页”内容时,nav中的“博客”高亮,
// 阅读“偷师tapable三个技术点”内容时,nav中的“博客”失去高亮
{ text: "博客", link: "/blog/index-page", activeMatch: "^/blog/" },
{
text: "工具",
// link: '/tool/index-page',
activeMatch: "^/tool/",
items: [{ text: "homebrew tool", link: "/tool/brew-tool" }],
items: [
{ text: 'Oh-my-zsh', link: '/tool/ohMyZsh' },
{ text: "homebrew tool", link: "/tool/brew-tool" },
{ text: "rust CLI tool", link: "/tool/rust-tool" },
{ text: 'vscode', link: '/tool/vscode-install' },
{ text: 'NPM', link: '/tool/index-npm' }

],
},
{
text: "优质链接",
Expand Down Expand Up @@ -188,28 +197,77 @@ export default defineConfig({
"/open-source": [
{ text: "首页", link: "/open-source/index-page" },
{ text: "个人学习项目", link: "/open-source/personnal-learn-project" },
{ text: '个人开发的应用项目', link: '/open-source/application' }
],
"/frontend": [
{ text: "首页", link: "/frontend/index-page" },
],
"/tool": [
{ text: "首页", link: "/tool/index-page" },
{ text: 'Oh-my-zsh', link: '/tool/ohMyZsh' },
{ text: "homebrew tool", link: "/tool/brew-tool" },
{ text: "rust CLI tool", link: "/tool/rust-tool" },
{
text: 'vscode',
items: [
{ text: '安装', link: '/tool/vscode-install' },
{ text: '常用配置', link: '/tool/vscode-config' },
{ text: '插件推荐', link: '/tool/vscode-plugin' },
{ text: 'vscode variables', link: '/tool/vscode-variables' },
{ text: 'tasks.json', link: '/tool/vscode-tasks' }
]
},
{
text: "Docker",
text: 'NPM',
items: [
{ text: "docker常用指令", link: "/tool/docker-cmd" },
{ text: "Dockerfile", link: "/tool/dockerfile" },
{ text: "Docker Composite", link: "/tool/docker-composite" },
],
{ text: '首页', link: '/tool/index-npm' },
{
text: 'package推荐',
collapsed: true,
items: [
{ text: '辅助研发', link: '/tool/npm-package-dev' },
{ text: '开发cmd', link: '/tool/npm-package-cmd' },
{ text: '文件系统', link: '/tool/npm-package-file-system' },
{ text: 'function tool', link: '/tool/npm-package-function-tool' },
{ text: '日志处理', link: '/tool/npm-package-log' },
{ text: '时间处理', link: '/tool/npm-package-time' },
{ text: '测试相关', link: '/tool/npm-package-test' },
{ text: 'module/package相关', link: '/tool/npm-package-module' },
{ text: 'http相关', link: '/tool/npm-package-http' },
{ text: 'UI', link: '/tool/npm-package-ui' },
{ text: 'web app framework', link: '/tool/npm-package-web-app-framework' },
{ text: 'docs website', link: '/tool/npm-package-docs-web' },
{ text: 'database', link: '/tool/npm-package-database' },
{ text: 'specific file', link: '/tool/npm-package-specific-file' },
{ text: 'data structure', link: '/tool/npm-package-data-structure' },
{ text: '动画', link: '/tool/npm-package-animation' },
{ text: '音视频', link: '/tool/npm-package-media' },
{ text: '图像', link: '/tool/npm-package-image' }
]
}
]
},
{
text: 'Rollup',
items: [
{ text: '插件推荐', link: '/tool/rollup/plugin' },
]
}
// {
// text: "Docker",
// items: [
// { text: "docker常用指令", link: "/tool/docker-cmd" },
// { text: "Dockerfile", link: "/tool/dockerfile" },
// { text: "Docker Composite", link: "/tool/docker-composite" },
// ],
// },
],
"/links": [
{ text: "首页", link: "/links/index-page" },
{ text: "技术热线", link: "/links/hotline" },
{ text: "社区", link: "/links/community" },
{ text: "开发者", link: "/links/personal" },
{ text: 'other source', link: '/links/other-source' }
],
},

Expand Down Expand Up @@ -246,7 +304,7 @@ export default defineConfig({
* 为此,舍弃127.0.0.1和localhost,通过 ifconfig | grep inet 查询电脑wifi
* 环境下的ip地址,作为服务器域名
*/
host: "192.168.1.5",
host: "localhost",
fs: {
// 来自 vue3-docs项目
allow: ["../.."],
Expand Down
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,56 @@
## Description

JasonZhang's personal website

in this website, you could see:

- JasonZhang's introduction
- front-end development articles
- rust articles
- go articles

## Tech
- `Vue3` + `vitepress`
- vite

- `Vue3` + `vitepress`
- vite
- naiveUI ( I hear it from a chatgpt project)
- [giscus](https://giscus.app/zh-CN), a comment component

## How do I create this project

- `npx vitepress init`, automatically create the project
- install other packages I need
- install other packages I need
- add some new features, insert new code and adopt matched techs

> if someone wants to make a project organized by `vite`, run `pnpm create vite`
## Notice During Development
at early time, `.vitepress` is located in `docs` directory,

at early time, `.vitepress` is located in `docs` directory,
I drag the `.vitepress` directory out from `docs` directory,
and locate it in the root project directory, so I have to change
and locate it in the root project directory, so I have to change
the command of starting dev server:
before: `vitepress dev docs`

> in this way, it means that `.vitepress` is under `docs` directory.
after: `vitepress dev`

## GitHub workflow

I create a workflow named 'Deploy' which is defined in `.github/workflow/deploy.yml`.

Every time I create PR, it will helps me re-deploy my website.

But sometimes, it doesn't work very well. My website will fall back to the default README page of Github style. I do a research, and catch the reason: `npm ci`.

When workflow runs and try to install dependencies with npm, if it doesn't find package-lock.json, `npm ci` might be failed.

By default, I use pnpm locally, to make everything simple, I add
[email protected] action into deploy.yml.

> make sure of pnpm-lock.yml, if it doesn't exist, pnpm install will be failed.
Everything works well.

If you want to search github actions or apps, please visit [github markplace](https://github.com/marketplace?category=&type=actions&verification=&query=setup-node)
23 changes: 23 additions & 0 deletions docs/links/other-source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: "其它资源"
page: true
aside: true
---

## Description

- 图像资源
- icon 资源
- 模型资源
- 技术无关的资源

## 模之屋

[前往](https://www.aplaybox.com/)

<LoadingPreviewCard url="https://www.aplaybox.com/" />

在上面访问原神官方账号,点赞+收藏,即可下载原神角色模型,比如 胡桃、芙宁娜、那维莱特、钟离、万叶、
泳装芭芭拉...

<Giscus />
Binary file modified docs/public/memory_structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/shell-vscode-open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/vscode-plugin-go.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/vscode-plugin-live-sass-compiler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/vscode-plugin-live-server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/vscode-plugin-open-in-browser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/vscode-plugin-rust-analyzer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/vscode-plugin-svg-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/vscode-plugin-thunder-client.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/vscode-plugin-todo-tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/vscode-plugin-volar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 20 additions & 18 deletions docs/rust/how-to-learn.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,37 @@ aside: true

## 在线读物

[Rust 编程语言](https://doc.rust-lang.org/book/ch19-03-advanced-traits.html#default-generic-type-parameters-and-operator-overloading)
[<<Rust 编程语言\>\>](https://doc.rust-lang.org/book/ch19-03-advanced-traits.html#default-generic-type-parameters-and-operator-overloading)

[Cargo Book](https://doc.rust-lang.org/cargo/guide/dependencies.html)
[<<Cargo Book\>\>](https://doc.rust-lang.org/cargo/guide/dependencies.html)

[rustc 手册](https://doc.rust-lang.org/rustc/index.html)
[<<rustc 手册\>\>](https://doc.rust-lang.org/rustc/index.html)

[Rust 命令行工具开发指南](https://rust-cli.github.io/book/index.html)
[<<Rust 命令行工具开发指南\>\>](https://rust-cli.github.io/book/index.html)

[rustdoc 手册](https://doc.rust-lang.org/rustdoc/index.html)
[<<rustdoc 手册\>\>](https://doc.rust-lang.org/rustdoc/index.html)

[rust 高级编程](https://learnku.com/docs/nomicon/2018)
[<<rust 高级编程\>\>](https://learnku.com/docs/nomicon/2018)

[通过例子学 Rust(中文版)](https://rustwiki.org/zh-CN/rust-by-example/fn/closures/output_parameters.html)
[<<通过例子学 Rust(中文版)\>\>](https://rustwiki.org/zh-CN/rust-by-example/fn/closures/output_parameters.html)

[Rust 中的 Unsafe](https://doc.rust-lang.org/nightly/nomicon/)
[<<Rust 中的 Unsafe\>\> ](https://doc.rust-lang.org/nightly/nomicon/)

[通过各种 list 学习 Rust](https://rust-unofficial.github.io/too-many-lists/)
[<<通过各种 list 学习 Rust\>\>](https://rust-unofficial.github.io/too-many-lists/)

[Rust 异步编程](https://rust-lang.github.io/async-book/)
[<<Rust 异步编程\>\>](https://rust-lang.github.io/async-book/)

[Rust Language Cheat Sheet](https://cheats.rs/)
[<<Rust Language Cheat Sheet\>\> ](https://cheats.rs/)

[Web Development In Rust](https://www.arewewebyet.org/)

[Rust 学习资源](https://github.com/rcore-os/rCore/wiki/study-resource-of-system-programming-in-RUST)
[ Rust 学习资源](https://github.com/rcore-os/rCore/wiki/study-resource-of-system-programming-in-RUST)

[rust 官网](https://www.rust-lang.org/zh-CN/learn)
[ rust 官网](https://www.rust-lang.org/zh-CN/learn)

[rust 官方 package 仓库](https://crates.io/)
[ rust 官方 package 仓库](https://crates.io/)

[rust 标准库](https://doc.rust-lang.org/std/index.html)
[ rust 标准库](https://doc.rust-lang.org/std/index.html)

## 按需找链接

Expand Down Expand Up @@ -85,7 +85,9 @@ aside: true
### rust 基础语法记不清了?

[the rust programming language](https://doc.rust-lang.org/book/title-page.html)

[rust reference | Introduction](https://doc.rust-lang.org/reference/introduction.html)

[rust by example | Introduction](https://doc.rust-lang.org/stable/rust-by-example/index.html)

### 看到语法表达记不起来啥意思,有些概念搞不清?
Expand Down Expand Up @@ -126,15 +128,15 @@ aside: true

一个命令行参数解析器

[crate](https://crates.io/crates/argh)
[crate 地址](https://crates.io/crates/argh)

### serde

`struct` `enum`的序列化和反序列化工具。

[website](https://serde.rs/field-attrs.html)

[crate](https://crates.io/crates/serde)
[crate 地址](https://crates.io/crates/serde)

### wasm-bindgen

Expand All @@ -146,6 +148,6 @@ aside: true

[website](https://rustwasm.github.io/docs/wasm-bindgen/examples/closures.html)

[crate](https://crates.io/crates/wasm-bindgen)
[crate 地址](https://crates.io/crates/wasm-bindgen)

<Giscus />
77 changes: 58 additions & 19 deletions docs/tool/brew-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,80 @@ page: true
aside: true
---

# homebrew工具
# homebrew 工具

## 安装 homebrew

### 官网方式

`/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"`

### 清华镜像方式

外网的问题,造成官网方式不可顺利下载,可以考虑清华镜像的方式

```shell
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"


git clone --depth=1 https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/install.git brew-install
/bin/bash brew-install/install.sh
rm -rf brew-install
```

安装完毕后,将 brew 指令注册到 shell 里:

```shell
test -r ~/.bash_profile && echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bash_profile
test -r ~/.zprofile && echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
```

最后,将 homebrew 的源替换为清华的:

```shell
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
brew tap --custom-remote --force-auto-update homebrew/core https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
brew tap --custom-remote --force-auto-update homebrew/cask-fonts https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
brew tap --custom-remote --force-auto-update homebrew/cask-drivers https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git
brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-versions.git
brew tap --custom-remote --force-auto-update homebrew/command-not-found https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-command-not-found.git
brew update
```

## asciinema

这款工具可以录制你的终端,将其转化为本地的动态图或者视频,也可以上传到其官网平台,拿到资源链接,
将其插入到网页或者markdown中
将其插入到网页或者 markdown 中

自身安装:
```sh
自身安装:

```sh
brew install asciinema
```

### 转化为本地的动态图
### 转化为本地的动态图

还需要安装一些额外的工具:
```sh

```sh
npm install -g asciicast2gif
brew install gifsicle
brew install imagemagick
brew install gifsicle
brew install imagemagick
```

> `asciicast2gif` 依赖 `gifsicle``imagemagick `

<br>

录制过程:

1. 在终端上,执行`asciinema rec demo.cast`
2. 开始你的终端操作,比如输入`git branch -vv`, 操作完毕后,按下 `Ctrl + D`, 结束录制
3. 生成gif图像 `asciicast2gif demo.cast demo.gif`
> 如果缺少依赖,可能会有这样的错误`error: ImageMagick not installed? Executable 'convert' not found`
> 你就要检查是否安装 `gifsicle``imagemagick`





3. 生成 gif 图像 `asciicast2gif demo.cast demo.gif`
> 如果缺少依赖,可能会有这样的错误`error: ImageMagick not installed? Executable 'convert' not found`
> 你就要检查是否安装 `gifsicle``imagemagick`
<Giscus />
<Giscus />
Loading

0 comments on commit dfce06f

Please sign in to comment.