Compare commits

...

5 Commits

Author SHA1 Message Date
eeade3cdfb
automatically show dependencies 2025-02-11 18:04:03 +01:00
481b34a472
label make clean 2025-02-11 15:37:55 +01:00
fd850761f3
add tags 2025-02-11 13:21:05 +01:00
b7729e5712
generate articles with makefile 2025-02-11 13:06:37 +01:00
bbd34e24ec
generate db with makefile 2025-02-11 12:55:07 +01:00
9 changed files with 52 additions and 31 deletions

44
Makefile Normal file
View File

@ -0,0 +1,44 @@
help: ## Print the help message
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
sort | \
column -s ':' -t
articles != find * -type f -name "*.md"
db.rec: $(articles)
for x in $^ ; do \
sed -n '2,/^---$$/ {/^---$$/d; p}' "$$x" |\
sed -e 's/\[ //' -e 's/ \]//' |\
tr -d '"' ;\
printf "file: %s\n\n" "$$x" ;\
done > $@
recsel $@ -e "requires != ''" -CR title,requires |\
while read title requires; do \
IFS=', ' && for provider in $$requires; do \
recset $@ -e "title = '$${provider}'" -f provides -a "$${title}" ;\
done ;\
done
default += db.rec
.git/info/exclude: $(default)
echo $^ | tr ' ' '\n' > $@
default += .git/info/exclude
.PHONY: database
database: $(default) ## Make a database for recfiles
.PHONY: article
article: ## Write an article
@path=$$(find . -type d -printf '%P\n' | fzy); \
read -p "Title: " title; \
printf '%s\n' '---' >> $$path/$$title.md ; \
printf 'title: "%s"\n' "$$title" >> $$path/$$title.md ; \
printf 'tags: [ "%s" ]\n' "$$path" | sed 's#\/#", "#g' >> $$path/$$title.md ; \
printf '%s\n\n' '---' >> $$path/$$title.md ;\
$(EDITOR) +5 $$path/$$title.md
.PHONY: clean
clean: ## Remove all generated files
$(RM) $(default)

View File

@ -1,6 +1,6 @@
---
title: "Board Games"
tags: [ "data", "recfiles" ]
tags: [ "data", "recfiles", "games" ]
---
You can play with a board games database from boardgamegeek.com.

View File

@ -1,6 +1,6 @@
---
title: "Soft Serve through https"
tags: [ "data", "git" ]
tags: [ "data", "git", "lfs" ]
---
## `http` Setup

View File

@ -1,6 +1,7 @@
---
title: "basic-install"
tags: [ "Documentation", "arch" ]
requires: [ "partitions", "time" ]
---
Keyboard layout changed.

View File

@ -1,6 +1,7 @@
---
title: "fail2ban"
tags: [ "Documentation", "Networking" ]
requires: [ "ssh" ]
---
# SSH Daemon Jail

View File

@ -1,6 +1,7 @@
---
title: "sshfs"
tags: [ "Documentation", "Networking" ]
requires: [ "ssh" ]
---
# Mount

View File

@ -1,6 +1,7 @@
---
title: "ssh tricks"
title: "ssh-tricks"
tags: [ "Documentation", "Networking", "ssh", "tricks" ]
requires: [ "ssh" ]
---
Mount a remote filesystem locally with fuse-sshfs:

27
new.sh
View File

@ -1,27 +0,0 @@
#!/bin/sh
echo Select a category
category="$(find . -type d -printf '%P\n' | fzy)"
[ ! -d "$category" ] && mkdir "$category"
echo Select a name
read name
filePath="$category/$(echo $name | sed 's/ /_/g').md"
tagsList="$(echo \"$category | sed 's#\/#", "#g')\""
[ -e "$filePath" ] && $EDITOR "$filePath" && exit 0
echo "---
title: \"$name\"
tags: [ $tagsList ]
---
" > "$filePath"
$EDITOR "$filePath"

View File

@ -1,6 +1,6 @@
---
title: "android"
tags: [ "Documentation", "System" ]
tags: [ "Documentation", "System", "phone" ]
---
# mtpfs