initial commit with stuff from arise
Some checks are pending
Deploy Arise to html branch / Deploy Arise (push) Waiting to run
Some checks are pending
Deploy Arise to html branch / Deploy Arise (push) Waiting to run
This commit is contained in:
commit
0faf445b39
62 changed files with 3401 additions and 0 deletions
26
lib/functions/subshell/evaluate_inline.sh
Normal file
26
lib/functions/subshell/evaluate_inline.sh
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
#############
|
||||
# DESCRIPTION
|
||||
#############
|
||||
# Evaluates inline bash snippets when building pages.
|
||||
#
|
||||
# This functionality is currently disabled for initial release because even though it "works". When called by build_page, the parsing isn't very good and the syntax for calling an inline evaluation could use some work.
|
||||
#
|
||||
#############
|
||||
# Function Usage:
|
||||
# evaluate_inline index.html
|
||||
#
|
||||
# Inline Snippet Usage:
|
||||
# <pre>sh# echo "Hello World!" </pre>
|
||||
|
||||
evaluate_inline() (
|
||||
|
||||
evaluation_source=$(basename $1)
|
||||
cd $(dirname $1)
|
||||
|
||||
while grep "<pre>sh#" $evaluation_source
|
||||
do
|
||||
replacement=$(bash <<< $(sed -n -e s$'\001''<pre>sh#\(.*\)</pre>'$'\001''\1'$'\001''p' < $evaluation_source | head -1))
|
||||
awk 'NR==1,/<pre>sh#.*<\/pre>/{sub(/<pre>sh#.*<\/pre>/, "'"$replacement"'")}{print >"'"$evaluation_source"'"}' $evaluation_source || break
|
||||
done
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue