parent
7ee04bbe8e
commit
f05cff70b9
|
|
@ -0,0 +1,21 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
cd "$(dirname "$BASH_SOURCE")"
|
||||||
|
files_d="$PWD/files"
|
||||||
|
runbooks_d="$HOME/repos/runbooks"
|
||||||
|
find "$runbooks_d" -type f -name "*.md" | while read -r line; do
|
||||||
|
relative="${line#$runbooks_d/}"
|
||||||
|
echo relative=$relative
|
||||||
|
mkdir -p "$files_d"/"${relative%.md}"
|
||||||
|
content="$(cat "$line" | jq -sR)"
|
||||||
|
printf '{
|
||||||
|
"content": %s,
|
||||||
|
"title": "%s"
|
||||||
|
}' "$content" "${relative##*/}" > "$files_d"/"${relative%.md}"/data.yaml
|
||||||
|
done
|
||||||
|
find "$files_d" -type d | while read -r files_d; do
|
||||||
|
echo asserting "$files_d/data.yaml"
|
||||||
|
if [ ! -f "$files_d"/data.yaml ]; then
|
||||||
|
printf '{"title": "%s"}' "${files_d##*/}" > "$files_d"/data.yaml
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
<style>
|
<style>
|
||||||
#tree {
|
#tree {
|
||||||
max-width: 15em;
|
max-width: 15em;
|
||||||
|
width: 15em;
|
||||||
|
min-width: 15em;
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
}
|
}
|
||||||
#tree > details summary {
|
#tree > details summary {
|
||||||
|
|
@ -281,6 +283,7 @@
|
||||||
link: ["[](", ")"],
|
link: ["[](", ")"],
|
||||||
},
|
},
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
|
lineWrapping: true,
|
||||||
uploadImage: true,
|
uploadImage: true,
|
||||||
imageUploadEndpoint: "/api/v0/media", // POST wants {data: {filePath: "/..."}}
|
imageUploadEndpoint: "/api/v0/media", // POST wants {data: {filePath: "/..."}}
|
||||||
imagePathAbsolute: false,
|
imagePathAbsolute: false,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue