Skip to content

Commit

Permalink
deploy: 961cbb0
Browse files Browse the repository at this point in the history
  • Loading branch information
xieby1 committed Dec 2, 2024
0 parents commit 24f4523
Show file tree
Hide file tree
Showing 321 changed files with 67,060 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
103 changes: 103 additions & 0 deletions .genSUMMARY.sh
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)"
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme/* linguist-vendored
8 changes: 8 additions & 0 deletions .gitignore
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/
6 changes: 6 additions & 0 deletions .markcode_progress.sh
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
1 change: 1 addition & 0 deletions .nojekyll
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.
15 changes: 15 additions & 0 deletions .parent_dirs.sh
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
226 changes: 226 additions & 0 deletions 404.html

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions FontAwesome/css/font-awesome.css

Large diffs are not rendered by default.

Binary file added FontAwesome/fonts/FontAwesome.ttf
Binary file not shown.
Binary file added FontAwesome/fonts/fontawesome-webfont.eot
Binary file not shown.
2,671 changes: 2,671 additions & 0 deletions FontAwesome/fonts/fontawesome-webfont.svg
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 FontAwesome/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file added FontAwesome/fonts/fontawesome-webfont.woff
Binary file not shown.
Binary file added FontAwesome/fonts/fontawesome-webfont.woff2
Binary file not shown.
15 changes: 15 additions & 0 deletions Makefile
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}
./$< > $@
78 changes: 78 additions & 0 deletions ayu-highlight.css
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;
}
Loading

0 comments on commit 24f4523

Please sign in to comment.