Skip to content

Commit fa92934

Browse files
committed
deploy: 2a20d69
0 parents  commit fa92934

626 files changed

Lines changed: 118739 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use nix

.genSUMMARY.sh

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#!/usr/bin/env bash
2+
3+
getTitle() {
4+
PATHMD=$1
5+
head -n 3 "${PATHMD}" | awk '/^# / {$1=""; print substr($0,2); exit;}'
6+
}
7+
genDir() {
8+
Dir=$1
9+
for PATHMD in $(find $Dir -name "*.md" -exec ./.parent_dirs.sh {} \; | sort -n | uniq); do
10+
11+
# remove tailing slash for dir
12+
PATHMD=${PATHMD%/}
13+
14+
# README.md & index.md belongs to current folder
15+
NAMEMD=${PATHMD##*/}
16+
if [[ ${NAMEMD} =~ README.*md || ${NAMEMD} == "index.md" || ${NAMEMD} == "SUMMARY.md" ]]; then
17+
continue
18+
fi
19+
20+
# ignore .
21+
if [[ ${PATHMD} == "." ]]; then
22+
continue
23+
fi
24+
25+
# count indentation # $PATHMD = ./miao/wang/x.md
26+
TMP1=${PATHMD#./} # TMP1 = miao/wang/x.md
27+
TMP2=${TMP1//[^\/]} # TMP2 = //
28+
INDENT=${#TMP2} # INDENT = 2
29+
30+
for (( i=0; i<${INDENT}; i++ )); do
31+
echo -n " "
32+
done
33+
34+
if [[ -f ${PATHMD} ]]; then
35+
TITLE=$(getTitle "${PATHMD}")
36+
if [[ -n ${TITLE} ]]; then
37+
echo "* [${TITLE}](${PATHMD})"
38+
else
39+
echo "* [${NAMEMD}](${PATHMD})"
40+
fi
41+
elif [[ -f ${PATHMD}/index.md ]]; then
42+
TITLE=$(getTitle "${PATHMD}/index.md")
43+
if [[ -n ${TITLE} ]]; then
44+
echo "* [${TITLE}](${PATHMD}/index.md)"
45+
else
46+
echo "* [${NAMEMD}/](${PATHMD}/index.md)"
47+
fi
48+
elif [[ -f ${PATHMD}/README.md ]]; then
49+
TITLE=$(getTitle "${PATHMD}/README.md")
50+
if [[ -n ${TITLE} ]]; then
51+
echo "* [${TITLE}](${PATHMD}/README.md)"
52+
else
53+
echo "* [${NAMEMD}/](${PATHMD}/README.md)"
54+
fi
55+
elif [[ -d ${PATHMD} ]]; then
56+
echo "* [${NAMEMD}/]()"
57+
else
58+
echo "* [${NAMEMD}]()"
59+
fi
60+
done
61+
}
62+
63+
echo "# Summary"
64+
echo
65+
echo "# 🏠主页"
66+
echo
67+
echo "* [📔README.md](./README.md)"
68+
echo
69+
echo "# 🌏全局配置"
70+
echo
71+
echo "* [config.nix](./config.nix.md)"
72+
echo "* [TODO: nix/nix.conf](./nix/nix.conf.md)"
73+
echo "* [opt.nix](./opt.nix.md)"
74+
echo
75+
echo "# 🖥️系统配置(需sudo,用于NixOS)"
76+
echo
77+
echo "* [system.nix](./system.nix.md)"
78+
genDir ./sys/
79+
echo
80+
echo "# 😺用户配置(无需sudo,用于Nix/NixOS)"
81+
echo
82+
echo "* [home.nix](./home.nix.md)"
83+
genDir ./usr/
84+
echo
85+
echo "# 🤖安卓配置(无需sudo,复用\"用户配置\")"
86+
echo
87+
echo "* [nix-on-droid.nix](./nix-on-droid.nix.md)"
88+
echo
89+
echo "# 🔩通用模块"
90+
echo
91+
genDir ./modules/
92+
echo
93+
echo "# 📝文档和心得体会"
94+
echo
95+
genDir ./docs/
96+
echo
97+
echo "# 📃Nix脚本(nix-shell和打包)"
98+
echo
99+
genDir ./scripts/
100+
echo
101+
echo "# 📌其他"
102+
echo
103+
echo "* [shell.nix](./shell.nix.md)"

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme/* linguist-vendored

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
result*
2+
.direnv
3+
book/
4+
SUMMARY.md
5+
*.nix.md
6+
nix/nix.conf.md
7+
opt-local.nix
8+
.ccache/
9+
.crush

.markcode_progress.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
n=$(grep "#MC" -rl --include="*.nix" | grep -v "book/" | wc -l)
4+
d=$(find -name "*.nix" | grep -v "book/" | wc -l)
5+
6+
sed -i '1 s,[0-9]\+/[0-9]\+,'$n'/'$d',' ./README.md

.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This file makes sure that Github Pages doesn't process mdBook's output.

.parent_dirs.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
path="$1"
4+
echo $path
5+
dir=$(dirname "$path")
6+
while true; do
7+
echo $dir/
8+
9+
dirdir=$(dirname "$dir")
10+
if [[ "$dir" != "$dirdir" ]]; then
11+
dir="$dirdir"
12+
else
13+
break
14+
fi
15+
done

404.html

Lines changed: 226 additions & 0 deletions
Large diffs are not rendered by default.

FontAwesome/css/font-awesome.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FontAwesome/fonts/FontAwesome.ttf

162 KB
Binary file not shown.

0 commit comments

Comments
 (0)