From 1d68d0267d7e8f82649a42fcadc408c8f5a1f070 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Wed, 2 Dec 2020 00:12:06 +0300 Subject: . --- artcles/funweb.vs | 9 +++++++++ artcles/someweb.vs | 10 ++++++++++ articles.vs | 5 +++++ default.do | 8 ++++---- index.html.st | 5 ----- main.st | 4 ---- shelter.sh | 3 --- vsvs.sh | 1 + 8 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 artcles/funweb.vs create mode 100644 artcles/someweb.vs create mode 100644 articles.vs delete mode 100644 index.html.st delete mode 100644 main.st delete mode 100755 shelter.sh diff --git a/artcles/funweb.vs b/artcles/funweb.vs new file mode 100644 index 0000000..a7770e1 --- /dev/null +++ b/artcles/funweb.vs @@ -0,0 +1,9 @@ +title Web must be fun! +content + This operator can be used on a quotation or a dictionary:
+ If a quotation quot is passed, it returns a new quotation + obtained by evaluating each element of quot in a separate stack.
+ If a dictionary dict (with values and keys) is passed, + it returns a new dictionary obtained by evaluating each value + in the dict that is a symbol in a separate stack + (values that aren’t symbols stay as they are). diff --git a/artcles/someweb.vs b/artcles/someweb.vs new file mode 100644 index 0000000..4ef95a1 --- /dev/null +++ b/artcles/someweb.vs @@ -0,0 +1,10 @@ +title Web must be! +content + Yeap! + This operator can be used on a quotation or a dictionary:
+ If a quotation quot is passed, it returns a new quotation + obtained by evaluating each element of quot in a separate stack.
+ If a dictionary dict (with values and keys) is passed, + it returns a new dictionary obtained by evaluating each value + in the dict that is a symbol in a separate stack + (values that aren’t symbols stay as they are). diff --git a/articles.vs b/articles.vs new file mode 100644 index 0000000..902c495 --- /dev/null +++ b/articles.vs @@ -0,0 +1,5 @@ +template + + $title + $content + diff --git a/default.do b/default.do index 9baba44..ee79c29 100755 --- a/default.do +++ b/default.do @@ -1,5 +1,5 @@ #!/bin/sh -if test -f $1.st -then - { shelter.sh $1.st >$3; } 3>&1 | xargs redo-ifchange -fi +export title="$(vsvs.sh title < $1.vs)" +export content="$(vsvs.sh content < $1.vs)" +echo -n "$(vsvs.sh template < articles.vs)" | shelter >$3; +redo-ifchange $1.vs articles.vs diff --git a/index.html.st b/index.html.st deleted file mode 100644 index 176b0ce..0000000 --- a/index.html.st +++ /dev/null @@ -1,5 +0,0 @@ -$( - export title="Welcome" - export content="Hello, World." - shelter.sh main.st -) diff --git a/main.st b/main.st deleted file mode 100644 index e9339f2..0000000 --- a/main.st +++ /dev/null @@ -1,4 +0,0 @@ - -$title -$content - diff --git a/shelter.sh b/shelter.sh deleted file mode 100755 index 7f7f044..0000000 --- a/shelter.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -echo $1 >&3 -shelter <$1 diff --git a/vsvs.sh b/vsvs.sh index 4362729..d3b6764 100755 --- a/vsvs.sh +++ b/vsvs.sh @@ -1,3 +1,4 @@ +#!/bin/sh res="" met=false while IFS="" read str -- cgit v1.2.3