From ed93a442632a517749f3ffaba6f8bd15cb68116b Mon Sep 17 00:00:00 2001 From: kiicia Date: Mon, 28 May 2018 21:45:44 +0200 Subject: [PATCH] creating valid epub structure --- .gitignore | 1 + prolog/attributedvariables.html | 3 +- prolog/ebook.sh | 62 +++++++++++++++++++++++++++++++++ prolog/kindle.css | 34 ++++++++++++++++++ prolog/puzzles.html | 4 +-- 5 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 .gitignore create mode 100644 prolog/ebook.sh create mode 100644 prolog/kindle.css diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46106f7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +ebook diff --git a/prolog/attributedvariables.html b/prolog/attributedvariables.html index 0393534..6a2eab4 100644 --- a/prolog/attributedvariables.html +++ b/prolog/attributedvariables.html @@ -1,4 +1,4 @@ - + Attributed Variables in Prolog @@ -1400,7 +1400,6 @@ and hence fail. -

Further reading and future work

Attributed variables are typically used to implement constraint diff --git a/prolog/ebook.sh b/prolog/ebook.sh new file mode 100644 index 0000000..d125d84 --- /dev/null +++ b/prolog/ebook.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +ebook_dir="./ebook" +content="$ebook_dir/content.opf" +manifest="$ebook_dir/manifest" +spine="$ebook_dir/spine" +toc="$ebook_dir/toc.ncx" + +echo "dir: $ebook_dir" + +if [ -d "$ebook_dir" ]; then + rm -rf "$ebook_dir" +fi +mkdir "$ebook_dir" + +cp "kindle.css" "$ebook_dir/kindle.css" + +for chapter in *.html; do + echo "chapter: $chapter" + chapter_file="$ebook_dir/$chapter" + echo " " >> "$manifest" + echo " " >> "$spine" + awk '{\ +gsub(" style=\"[^\"]+?\"","");\ +gsub("","");\ +sub("","");\ +sub("","");\ +print\ +}' "$chapter" > "$chapter_file" +done + +echo ' + + + urn:uuid:ca006611-474d-43a3-9a76-c06b86ac020b + Markus Triska + The Power of Prolog + en + 2018-05-28 + + ' >> "$content" +echo '' >> "$content" +cat "$manifest" >> "$content" +echo ' + ' >> "$content" +cat "$spine" >> "$content" +echo ' + + +' >> "$content" + +rm "$manifest" "$spine" + +echo ' + + + + + +' >> "$toc" + +echo "prepared ebook data, zip files in ebook directory and rename file to .epub" \ No newline at end of file diff --git a/prolog/kindle.css b/prolog/kindle.css new file mode 100644 index 0000000..1dc670b --- /dev/null +++ b/prolog/kindle.css @@ -0,0 +1,34 @@ +h1 { + font-size: 3em; + page-break-before: always; +} + +a { + color: black !important; + text-decoration: underline !important; +} + +.box { + background: lightgray; + padding: 1em; + margin-left: 3em; +} + +.example { + border: 1px solid gray; + padding: 1em; +} + +.query { + background: lightgray; +} + +.secret { + background: gray; + color: white; + padding: 0.2em; +} + +b>tt, pre { + margin-left: 1em; +} diff --git a/prolog/puzzles.html b/prolog/puzzles.html index 261fd24..c337f2c 100644 --- a/prolog/puzzles.html +++ b/prolog/puzzles.html @@ -277,8 +277,8 @@ implication_chain([], Prev) --> [Prev]. implication_chain(Vs0, Prev) --> [Prev], { select(V, Vs0, Vs) }, - ( { taut(Prev =< V, 1) } -> implication_chain(Vs, V) - ; { taut(Prev =< ~V, 1) } -> implication_chain(Vs, ~V) + ( { taut(Prev => V, 1) } -> implication_chain(Vs, V) + ; { taut(Prev => ~V, 1) } -> implication_chain(Vs, ~V) ).