Skip to content

Commit

Permalink
re-order doc slidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
wjwei-handsome committed Dec 20, 2023
1 parent ff0139b commit 8addf2c
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 71 deletions.
2 changes: 1 addition & 1 deletion docs/Algorithm/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "Algorithm",
"position": 9,
"position": 7,
"link": {
"type": "generated-index",
"description": "Algorithm!",
Expand Down
2 changes: 1 addition & 1 deletion docs/Bioinfo/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "Bioinformatics",
"position": 5,
"position": 4,
"link": {
"type": "generated-index",
"description": "Bioinformatics",
Expand Down
28 changes: 0 additions & 28 deletions docs/Bioinfo/basic.mdx

This file was deleted.

5 changes: 3 additions & 2 deletions docs/Linux/_category_.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"label": "Linux",
"position": 3,
"position": 2,
"link": {
"type": "generated-index",
"description": "About Linux and Shell",
"image": "/img/icon/linux.png"
}
},
"collapsed": false
}
15 changes: 0 additions & 15 deletions docs/Linux/basic.mdx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Linux/MacOS 中 Shell 命令行技巧分享
description: 命令行的花样玩法
tags: [command-line]
sidebar_position: 3
sidebar_position: 1
---

import ReferenceList from "@site/src/components/ReferenceList";
Expand Down Expand Up @@ -77,7 +77,7 @@ make install ## 一般而言你没权限装到系统目录,所以需要指定

#### 配置主题

我比较喜欢干净简洁的 `pure` 主题: https://github.com/pure-fish/pure
我比较喜欢干净简洁的 `pure` 主题:https://github.com/pure-fish/pure

### 特点

Expand Down Expand Up @@ -223,7 +223,7 @@ cargo!
## `bat` 替代 `cat`

bat 是用 Rust 写的 cat 的替代品,有以下特点:
- 语法高亮: 支持绝大部分主流语言语法高亮
- 语法高亮:支持绝大部分主流语言语法高亮
- Git 集成:支持显示文件修改前后的差异
- 自动分页:支持自动分页,不需要 `cat | less`
- 可显示不可见字符:比如空格,tab,换行符等
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
title: fish 与 module 的结合
description: 在 Fish 环境中使用 module
tags: [command-line]
sidebar_position: 4
sidebar_position: 2
---

## 背景

之前一直使用 `Fish Shell` 来作为生产力,但是在本校的集群环境下,其中有个痛点就行不支持原生的 `module`, 因为之前系统安装的版本过低,所以需着手解决这个问题.
之前一直使用 `Fish Shell` 来作为生产力,但是在本校的集群环境下,其中有个痛点就行不支持原生的 `module`, 因为之前系统安装的版本过低,所以需着手解决这个问题

## 定位问题

首先根据集群的 [官方文档](http://hpc.ncpgr.cn/app/004-Module/#module_2) 所述:
首先根据集群的 [官方文档](http://hpc.ncpgr.cn/app/004-Module/#module_2) 所述

```shell
export PATH="/public/home/software/opt/moudles/Modules/3.2.10/bin/:/opt/ibm/lsf/10.1/linux3.10-glibc2.17-x86_64/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin"
Expand All @@ -20,15 +20,15 @@ source /public/home/software/opt/moudles/Modules/3.2.10/init/bash

这两行一个是添加了 module 的路径,一个是初始化 module.

但是在 `Fish` 环境下,不可能 `source ***.bash`, 然后查看目录 `/public/home/software/opt/moudles/Modules/3.2.10/init/`, 发现并没有 `fish` 对应的初始化的脚本.
但是在 `Fish` 环境下,不可能 `source ***.bash`, 然后查看目录 `/public/home/software/opt/moudles/Modules/3.2.10/init/`, 发现并没有 `fish` 对应的初始化的脚本

查看 `module`[官方更新文档](https://modules.readthedocs.io/en/stable/MIGRATING.html), 发现更新后的版本已经支持 `fish`.
查看 `module`[官方更新文档](https://modules.readthedocs.io/en/stable/MIGRATING.html), 发现更新后的版本已经支持 `fish`

所以解决方式就是安装一个用户的 `module`.

## 安装 `module`

根据官网的 [文档](https://modules.readthedocs.io/en/stable/INSTALL.html), 安装步骤如下:
根据官网的 [文档](https://modules.readthedocs.io/en/stable/INSTALL.html), 安装步骤如下

### 下载解压

Expand All @@ -48,33 +48,33 @@ make install

### 配置

首先需要做之前提到的初始化,对应的命令是:
首先需要做之前提到的初始化,对应的命令是

```shell
source YOUR_PREFIX/init/fish
```

为了每次登陆都生效,可以写到 fish 的 config 中,添到 `~/.config/fish/config.fish` 文件即可.
为了每次登陆都生效,可以写到 fish 的 config 中,添到 `~/.config/fish/config.fish` 文件即可

这样一来,就可以运行 module 了,并且还做好了命令补全:
这样一来,就可以运行 module 了,并且还做好了命令补全

![module](https://raw.githubusercontent.com/wjwei-handsome/wwjPic/main/img/20231023165751.png)

### 添加 modulefiles

最重要的就是要添加集群已经配置好的 modulefiles, 好在即使 module 的版本在更新,但是 modulefiles 还是可以共用的.
最重要的就是要添加集群已经配置好的 modulefiles, 好在即使 module 的版本在更新,但是 modulefiles 还是可以共用的

寻找集群已配置的环境变量,查阅 `/public/home/software/opt/moudles/Modules/3.2.10/init/bash` 文件,发现如下配置:
寻找集群已配置的环境变量,查阅 `/public/home/software/opt/moudles/Modules/3.2.10/init/bash` 文件,发现如下配置

```shell
MODULESHOME=/public/home/software/opt/moudles/Modules/3.2.10
MODULEPATH=`sed -n's/[ #].*$//; /./H; $ { x; s/^\n//; s/\n/:/g; p; }' ${MODULESHOME}/init/.modulespath`
export MODULEPATH
```

这样可以直接拿到 `$MODULEPATH` 这个环境变量,然后把添加到自己安装的 module 的 init 脚本中即可.
这样可以直接拿到 `$MODULEPATH` 这个环境变量,然后把添加到自己安装的 module 的 init 脚本中即可

示例如下,修改 `~/modules/init/fish` 文件:
示例如下,修改 `~/modules/init/fish` 文件

```shell
...
Expand Down
2 changes: 1 addition & 1 deletion docs/Potpourri/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "Potpourri",
"position": 4,
"position": 3,
"link": {
"type": "generated-index",
"description": "个人常用的工具和大杂烩",
Expand Down
2 changes: 1 addition & 1 deletion docs/Python/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "Python",
"position": 2,
"position": 6,
"link": {
"type": "generated-index",
"description": "Python: My first love",
Expand Down
2 changes: 1 addition & 1 deletion docs/R/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "R",
"position": 6,
"position": 8,
"link": {
"type": "generated-index",
"description": "R language",
Expand Down
2 changes: 1 addition & 1 deletion docs/Rust/_category_.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"label": "Rust",
"position": 7,
"position": 5,
"link": {
"type": "generated-index",
"description": "Rust: A language empowering everyone to build reliable and efficient software.",
Expand Down
8 changes: 4 additions & 4 deletions src/data/gridListData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ function gridItem(
}

const DocGridList: Array<GridItemType> = [
gridItem("Python", "/docs/category/python", python),
gridItem("Linux", "/docs/category/linux", linux),
gridItem("Potpourri", "/docs/category/potpourri", potpourri),
gridItem("R", "/docs/category/r", rlang),
gridItem("Bio-Info", "/docs/category/bioinformatics", bioinfo),
gridItem("Rust", "/docs/category/rust", rust),
// gridItem("Django", "/docs/category/django", django),
gridItem("Python", "/docs/category/python", python),
gridItem("Algorithm", "/docs/category/algorithm", algorithm),
gridItem("R", "/docs/category/r", rlang),
// gridItem("Django", "/docs/category/django", django),
];


export { DocGridList, };
export { DocGridList, };

1 comment on commit 8addf2c

@vercel
Copy link

@vercel vercel bot commented on 8addf2c Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.