-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 24f4523
Showing
321 changed files
with
67,060 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#!/usr/bin/env bash | ||
|
||
getTitle() { | ||
PATHMD=$1 | ||
head -n 3 "${PATHMD}" | awk '/^# / {$1=""; print substr($0,2); exit;}' | ||
} | ||
genDir() { | ||
Dir=$1 | ||
for PATHMD in $(find $Dir -name "*.md" -exec ./.parent_dirs.sh {} \; | sort -n | uniq); do | ||
|
||
# remove tailing slash for dir | ||
PATHMD=${PATHMD%/} | ||
|
||
# README.md & index.md belongs to current folder | ||
NAMEMD=${PATHMD##*/} | ||
if [[ ${NAMEMD} =~ README.*md || ${NAMEMD} == "index.md" || ${NAMEMD} == "SUMMARY.md" ]]; then | ||
continue | ||
fi | ||
|
||
# ignore . | ||
if [[ ${PATHMD} == "." ]]; then | ||
continue | ||
fi | ||
|
||
# count indentation # $PATHMD = ./miao/wang/x.md | ||
TMP1=${PATHMD#./} # TMP1 = miao/wang/x.md | ||
TMP2=${TMP1//[^\/]} # TMP2 = // | ||
INDENT=${#TMP2} # INDENT = 2 | ||
|
||
for (( i=0; i<${INDENT}; i++ )); do | ||
echo -n " " | ||
done | ||
|
||
if [[ -f ${PATHMD} ]]; then | ||
TITLE=$(getTitle "${PATHMD}") | ||
if [[ -n ${TITLE} ]]; then | ||
echo "* [${TITLE}](${PATHMD})" | ||
else | ||
echo "* [${NAMEMD}](${PATHMD})" | ||
fi | ||
elif [[ -f ${PATHMD}/index.md ]]; then | ||
TITLE=$(getTitle "${PATHMD}/index.md") | ||
if [[ -n ${TITLE} ]]; then | ||
echo "* [${TITLE}](${PATHMD}/index.md)" | ||
else | ||
echo "* [${NAMEMD}/](${PATHMD}/index.md)" | ||
fi | ||
elif [[ -f ${PATHMD}/README.md ]]; then | ||
TITLE=$(getTitle "${PATHMD}/README.md") | ||
if [[ -n ${TITLE} ]]; then | ||
echo "* [${TITLE}](${PATHMD}/README.md)" | ||
else | ||
echo "* [${NAMEMD}/](${PATHMD}/README.md)" | ||
fi | ||
elif [[ -d ${PATHMD} ]]; then | ||
echo "* [${NAMEMD}/]()" | ||
else | ||
echo "* [${NAMEMD}]()" | ||
fi | ||
done | ||
} | ||
|
||
echo "# Summary" | ||
echo | ||
echo "# 🏠主页" | ||
echo | ||
echo "* [📔README.md](./README.md)" | ||
echo | ||
echo "# 🌏全局配置" | ||
echo | ||
echo "* [config.nix](./config.nix.md)" | ||
echo "* [TODO: nix/nix.conf](./nix/nix.conf.md)" | ||
echo "* [opt.nix](./opt.nix.md)" | ||
echo | ||
echo "# 🖥️系统配置(需sudo,用于NixOS)" | ||
echo | ||
echo "* [system.nix](./system.nix.md)" | ||
genDir ./sys/ | ||
echo | ||
echo "# 😺用户配置(无需sudo,用于Nix/NixOS)" | ||
echo | ||
echo "* [home.nix](./home.nix.md)" | ||
genDir ./usr/ | ||
echo | ||
echo "# 🤖安卓配置(无需sudo,复用\"用户配置\")" | ||
echo | ||
echo "* [nix-on-droid.nix](./nix-on-droid.nix.md)" | ||
echo | ||
echo "# 🔩通用模块" | ||
echo | ||
genDir ./modules/ | ||
echo | ||
echo "# 📝文档和心得体会" | ||
echo | ||
genDir ./docs/ | ||
echo | ||
echo "# 📃Nix脚本(nix-shell和打包)" | ||
echo | ||
genDir ./scripts/ | ||
echo | ||
echo "# 📌其他" | ||
echo | ||
echo "* [shell.nix](./shell.nix.md)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
theme/* linguist-vendored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
result* | ||
.direnv | ||
book/ | ||
SUMMARY.md | ||
*.nix.md | ||
nix/nix.conf.md | ||
opt-local.nix | ||
.ccache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
n=$(grep "#MC" -rl --include="*.nix" | grep -v "book/" | wc -l) | ||
d=$(find -name "*.nix" | grep -v "book/" | wc -l) | ||
|
||
sed -i '1 s,[0-9]\+/[0-9]\+,'$n'/'$d',' ./README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This file makes sure that Github Pages doesn't process mdBook's output. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
path="$1" | ||
echo $path | ||
dir=$(dirname "$path") | ||
while true; do | ||
echo $dir/ | ||
|
||
dirdir=$(dirname "$dir") | ||
if [[ "$dir" != "$dirdir" ]]; then | ||
dir="$dirdir" | ||
else | ||
break | ||
fi | ||
done |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
all: SUMMARY.md | ||
mdbook build | ||
|
||
NIXs = $(shell find . -name "*.nix" -not -path "./book*") | ||
NIX_MDs = $(addsuffix .md,${NIXs}) | ||
%.md: % | ||
markcode $< > $@ | ||
|
||
# update markcode progross | ||
README.md: ./.markcode_progress.sh ${NIXs} | ||
./$< | ||
|
||
ALL_MDs = $(shell find . -name "*.md" -not -name "SUMMARY.md") | ||
SUMMARY.md: .genSUMMARY.sh ${NIX_MDs} ${ALL_MDs} | ||
./$< > $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
Based off of the Ayu theme | ||
Original by Dempfi (https://github.com/dempfi/ayu) | ||
*/ | ||
|
||
.hljs { | ||
display: block; | ||
overflow-x: auto; | ||
background: #191f26; | ||
color: #e6e1cf; | ||
} | ||
|
||
.hljs-comment, | ||
.hljs-quote { | ||
color: #5c6773; | ||
font-style: italic; | ||
} | ||
|
||
.hljs-variable, | ||
.hljs-template-variable, | ||
.hljs-attribute, | ||
.hljs-attr, | ||
.hljs-regexp, | ||
.hljs-link, | ||
.hljs-selector-id, | ||
.hljs-selector-class { | ||
color: #ff7733; | ||
} | ||
|
||
.hljs-number, | ||
.hljs-meta, | ||
.hljs-builtin-name, | ||
.hljs-literal, | ||
.hljs-type, | ||
.hljs-params { | ||
color: #ffee99; | ||
} | ||
|
||
.hljs-string, | ||
.hljs-bullet { | ||
color: #b8cc52; | ||
} | ||
|
||
.hljs-title, | ||
.hljs-built_in, | ||
.hljs-section { | ||
color: #ffb454; | ||
} | ||
|
||
.hljs-keyword, | ||
.hljs-selector-tag, | ||
.hljs-symbol { | ||
color: #ff7733; | ||
} | ||
|
||
.hljs-name { | ||
color: #36a3d9; | ||
} | ||
|
||
.hljs-tag { | ||
color: #00568d; | ||
} | ||
|
||
.hljs-emphasis { | ||
font-style: italic; | ||
} | ||
|
||
.hljs-strong { | ||
font-weight: bold; | ||
} | ||
|
||
.hljs-addition { | ||
color: #91b362; | ||
} | ||
|
||
.hljs-deletion { | ||
color: #d96c75; | ||
} |
Oops, something went wrong.