mirror of
https://github.com/sbrl/powahroot.git
synced 2024-11-21 22:22:59 +00:00
Work a bit on the CSS of the docs, but it's not finished yet
We need moar colour :D :D :D
This commit is contained in:
parent
e6570a275a
commit
9c99cec593
2 changed files with 80 additions and 5 deletions
25
build
25
build
|
@ -36,6 +36,7 @@ if [[ "$#" -lt 1 ]]; then
|
|||
echo -e "${CSECTION}Available actions${RS}";
|
||||
echo -e " ${CACTION}setup${RS} - Perform initial setup";
|
||||
echo -e " ${CACTION}docs${RS} - Render the API docs to HTML";
|
||||
echo -e " ${CACTION}docs-watch${RS} - Auto-update the docs on source file modification";
|
||||
echo -e " ${CACTION}archive${RS} - Create an archive of CI artifacts";
|
||||
echo -e " ${CACTION}ci${RS} - Do CI tasks";
|
||||
echo -e "";
|
||||
|
@ -67,16 +68,38 @@ task_docs() {
|
|||
task_begin "Rendering API docs";
|
||||
|
||||
subtask_begin "Calling 'documentation'";
|
||||
node_modules/.bin/documentation build --output "${docs_output_folder}" --format html --favicon "logo.png" "$(jq --raw-output .main <package.json)";
|
||||
node_modules/.bin/documentation build --github --output "${docs_output_folder}" --format html --favicon "logo.png" "$(jq --raw-output .main <package.json)";
|
||||
subtask_end $? "'documentation' exited with an error";
|
||||
|
||||
subtask_begin "Linking logo to docs folder";
|
||||
cp -al "logo.png" "${docs_output_folder}/logo.png";
|
||||
subtask_end $? "Failed to link logo";
|
||||
|
||||
subtask_begin "Applying extra CSS";
|
||||
cat docs.css >>"$(find "${docs_output_folder}" -iname "*.css" -print -quit)";
|
||||
subtask_end $? "Failed to apply additional CSS";
|
||||
|
||||
task_end $? "Failed to render API docs";
|
||||
}
|
||||
|
||||
task_docs-watch() {
|
||||
check_command inotifywait;
|
||||
set_title "Docs Watcher";
|
||||
|
||||
echo -e "Watching for changes.";
|
||||
while :; do # : = infinite loop
|
||||
# Wait for an update
|
||||
# inotifywait's non-0 exit code forces an exit for some reason :-/
|
||||
inotifywait -qr --event modify --format '%:e %f' $(find . -iname "*.mjs" -not -path "./node_modules/*") ./docs.css;
|
||||
|
||||
# Rebuild the docs
|
||||
# This exits on error because of stage_end - we need add a way to make the exit on non-zero optional to lantern
|
||||
stage_begin "Rebuilding docs";
|
||||
tasks_run docs;
|
||||
stage_end $?;
|
||||
done
|
||||
}
|
||||
|
||||
task_archive() {
|
||||
task_end 1 "Error: Not implemented";
|
||||
}
|
||||
|
|
52
docs.css
Normal file
52
docs.css
Normal file
|
@ -0,0 +1,52 @@
|
|||
:root {
|
||||
--main-a: #9f1232;
|
||||
--main-b: #8c0f2b;
|
||||
--main-c: #730c24;
|
||||
|
||||
--green-a: #2d5203;
|
||||
--green-b: #345c05;
|
||||
--green-c: #366500;
|
||||
--green-d: #478105;
|
||||
|
||||
--bright-a: #ffa900;
|
||||
--bright-b: #ff9200;
|
||||
--bright-c: #ff7c00;
|
||||
|
||||
--light-a: #ede566;
|
||||
--light-b: #e0d742;
|
||||
--light-c: #cec31a;
|
||||
|
||||
--gutter-width: 20px;
|
||||
}
|
||||
|
||||
|
||||
.documentation.documentation {
|
||||
background: var(--green-c);
|
||||
color: var(--main-b);
|
||||
}
|
||||
|
||||
#split-left, h1, h2, h3, h4, h5, h6 {
|
||||
color: var(--bright-c) !important;
|
||||
}
|
||||
|
||||
.gutter.gutter.gutter-horizontal {
|
||||
background: var(--main-a);
|
||||
}
|
||||
.gutter.gutter.gutter-horizontal::after {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
align-items: center; text-align: center;
|
||||
|
||||
|
||||
color: var(--main-c);
|
||||
|
||||
content: ".. .. .. ..";
|
||||
line-height: 0.35em;
|
||||
|
||||
font-weight: bolder;
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
.bg-white.bg-white, #split-right {
|
||||
background: var(--light-a);
|
||||
}
|
Loading…
Reference in a new issue