mvp and poc it works with our volume of runbooks inc search

master v0.1.0
Bel LaPointe 2022-02-09 17:03:26 -07:00
parent 7ee04bbe8e
commit f05cff70b9
2 changed files with 24 additions and 0 deletions

View File

@ -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

View File

@ -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,