From 27e4dd82ded29ec6e6097b786428e3d33d130fb7 Mon Sep 17 00:00:00 2001 From: manetta Date: Thu, 17 Feb 2022 16:50:47 +0100 Subject: [PATCH] the pagedjs template is fixed now (not editable anymore in the interface) + other changes to the templates --- static/pagedjs.css | 180 +++++++++++++++++++++++++ templates/base.html | 3 +- templates/default-pandoc-template.html | 32 ----- templates/default.css | 16 ++- templates/default.md | 2 + templates/{html.html => iframe.html} | 2 +- templates/index.html | 4 - templates/pad.html | 5 - templates/pagedjs.html | 20 +++ templates/pandoc-template.html | 32 ----- templates/pdf.html | 2 +- templates/preview.html | 18 +++ 12 files changed, 234 insertions(+), 82 deletions(-) create mode 100644 static/pagedjs.css delete mode 100644 templates/default-pandoc-template.html rename templates/{html.html => iframe.html} (64%) delete mode 100644 templates/index.html delete mode 100644 templates/pad.html create mode 100644 templates/pagedjs.html delete mode 100644 templates/pandoc-template.html create mode 100644 templates/preview.html diff --git a/static/pagedjs.css b/static/pagedjs.css new file mode 100644 index 0000000..ff30f68 --- /dev/null +++ b/static/pagedjs.css @@ -0,0 +1,180 @@ +/* CSS for Paged.js interface – v0.2 */ + +/* Change the look */ +:root { + --color-background: whitesmoke; + --color-pageSheet: #cfcfcf; + --color-pageBox: violet; + --color-paper: white; + --color-marginBox: transparent; + --pagedjs-crop-color: black; + --pagedjs-crop-shadow: white; + --pagedjs-crop-stroke: 1px; +} + +/* To define how the book look on the screen: */ +@media screen { + body { + background-color: var(--color-background); + } + + .pagedjs_pages { + display: flex; + width: calc(var(--pagedjs-width) * 2); + flex: 0; + flex-wrap: wrap; + margin: 0 auto; + } + + .pagedjs_page { + background-color: var(--color-paper); + box-shadow: 0 0 0 1px var(--color-pageSheet); + margin: 0; + flex-shrink: 0; + flex-grow: 0; + margin-top: 10mm; + } + + .pagedjs_first_page { + margin-left: var(--pagedjs-width); + } + + .pagedjs_page:last-of-type { + margin-bottom: 10mm; + } + + .pagedjs_pagebox{ + box-shadow: 0 0 0 1px var(--color-pageBox); + } + + .pagedjs_left_page{ + z-index: 20; + width: calc(var(--pagedjs-bleed-left) + var(--pagedjs-pagebox-width))!important; + } + + .pagedjs_left_page .pagedjs_bleed-right .pagedjs_marks-crop { + border-color: transparent; + } + + .pagedjs_left_page .pagedjs_bleed-right .pagedjs_marks-middle{ + width: 0; + } + + .pagedjs_right_page{ + z-index: 10; + position: relative; + left: calc(var(--pagedjs-bleed-left)*-1); + } + + /* show the margin-box */ + + .pagedjs_margin-top-left-corner-holder, + .pagedjs_margin-top, + .pagedjs_margin-top-left, + .pagedjs_margin-top-center, + .pagedjs_margin-top-right, + .pagedjs_margin-top-right-corner-holder, + .pagedjs_margin-bottom-left-corner-holder, + .pagedjs_margin-bottom, + .pagedjs_margin-bottom-left, + .pagedjs_margin-bottom-center, + .pagedjs_margin-bottom-right, + .pagedjs_margin-bottom-right-corner-holder, + .pagedjs_margin-right, + .pagedjs_margin-right-top, + .pagedjs_margin-right-middle, + .pagedjs_margin-right-bottom, + .pagedjs_margin-left, + .pagedjs_margin-left-top, + .pagedjs_margin-left-middle, + .pagedjs_margin-left-bottom { + box-shadow: 0 0 0 1px inset var(--color-marginBox); + } + + /* uncomment this part for recto/verso book : ------------------------------------ */ +/* + + .pagedjs_pages { + flex-direction: column; + width: 100%; + } + + .pagedjs_first_page { + margin-left: 0; + } + + .pagedjs_page { + margin: 0 auto; + margin-top: 10mm; + } + + .pagedjs_left_page{ + width: calc(var(--pagedjs-bleed-left) + var(--pagedjs-pagebox-width) + var(--pagedjs-bleed-left))!important; + } + + .pagedjs_left_page .pagedjs_bleed-right .pagedjs_marks-crop{ + border-color: var(--pagedjs-crop-color); + } + + .pagedjs_left_page .pagedjs_bleed-right .pagedjs_marks-middle{ + width: var(--pagedjs-cross-size)!important; + } + + .pagedjs_right_page{ + left: 0; + } + */ + + + + /*--------------------------------------------------------------------------------------*/ + + + + /* uncomment this par to see the baseline : -------------------------------------------*/ + + /* + .pagedjs_pagebox { + --pagedjs-baseline: 22px; + --pagedjs-baseline-position: 5px; + --pagedjs-baseline-color: cyan; + background: linear-gradient(transparent 0%, transparent calc(var(--pagedjs-baseline) - 1px), var(--pagedjs-baseline-color) calc(var(--pagedjs-baseline) - 1px), var(--pagedjs-baseline-color) var(--pagedjs-baseline)), transparent; + background-size: 100% var(--pagedjs-baseline); + background-repeat: repeat-y; + background-position-y: var(--pagedjs-baseline-position); + } */ + + + /*--------------------------------------------------------------------------------------*/ +} + + + + + +/* Marks (to delete when merge in paged.js) */ + +.pagedjs_marks-crop{ + z-index: 999999999999; + +} + +.pagedjs_bleed-top .pagedjs_marks-crop, +.pagedjs_bleed-bottom .pagedjs_marks-crop{ + box-shadow: 1px 0px 0px 0px var(--pagedjs-crop-shadow); +} + +.pagedjs_bleed-top .pagedjs_marks-crop:last-child, +.pagedjs_bleed-bottom .pagedjs_marks-crop:last-child{ + box-shadow: -1px 0px 0px 0px var(--pagedjs-crop-shadow); +} + +.pagedjs_bleed-left .pagedjs_marks-crop, +.pagedjs_bleed-right .pagedjs_marks-crop{ + box-shadow: 0px 1px 0px 0px var(--pagedjs-crop-shadow); +} + +.pagedjs_bleed-left .pagedjs_marks-crop:last-child, +.pagedjs_bleed-right .pagedjs_marks-crop:last-child{ + box-shadow: 0px -1px 0px 0px var(--pagedjs-crop-shadow); +} diff --git a/templates/base.html b/templates/base.html index 3677f32..77419aa 100644 --- a/templates/base.html +++ b/templates/base.html @@ -26,8 +26,7 @@ window.addEventListener('load', function () {
: : - : - +
`; diff --git a/templates/default-pandoc-template.html b/templates/default-pandoc-template.html deleted file mode 100644 index 28e52d8..0000000 --- a/templates/default-pandoc-template.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - $title$ - - - - -
-

$title$

-
- -$if(toc)$ -
-$if(toc-title)$ -

$toc-title$

-$endif$ -$table-of-contents$ -
-$endif$ - -$body$ - - - diff --git a/templates/default.css b/templates/default.css index 325ee25..8834b83 100644 --- a/templates/default.css +++ b/templates/default.css @@ -1,10 +1,16 @@ +@charset "utf-8"; + +/* ADD SHORT TEXT HERE: THIS DOCUMENT SPEAKS CSS */ + @page{ - size: A5; + size: A5; } @page:first{ - background-color: pink; + background-color: pink; } -section#cover, -section#TOC{ - page-break-after: always; +body{ + color: green; +} +section#cover{ + page-break-after: always; } \ No newline at end of file diff --git a/templates/default.md b/templates/default.md index e2f1c2a..f69f862 100644 --- a/templates/default.md +++ b/templates/default.md @@ -3,4 +3,6 @@ title: hello! language: en --- + + # Hello? \ No newline at end of file diff --git a/templates/html.html b/templates/iframe.html similarity index 64% rename from templates/html.html rename to templates/iframe.html index cc98110..3dec887 100644 --- a/templates/html.html +++ b/templates/iframe.html @@ -1,5 +1,5 @@ {% extends "base.html" %} {% block content %} -{{ html | safe }} + {% endblock %} diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index 5b74f2d..0000000 --- a/templates/index.html +++ /dev/null @@ -1,4 +0,0 @@ -{% extends "base.html" %} - -{% block content %} -{% endblock %} diff --git a/templates/pad.html b/templates/pad.html deleted file mode 100644 index 38bd7a8..0000000 --- a/templates/pad.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "base.html" %} - -{% block content %} - -{% endblock %} diff --git a/templates/pagedjs.html b/templates/pagedjs.html new file mode 100644 index 0000000..509a2fe --- /dev/null +++ b/templates/pagedjs.html @@ -0,0 +1,20 @@ + + + + + + + + + {{ name }} + + +
+

{{ name }}

+
+ +
+
{{ pad_content | safe }}
+
+ + diff --git a/templates/pandoc-template.html b/templates/pandoc-template.html deleted file mode 100644 index 62757bb..0000000 --- a/templates/pandoc-template.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - $title$ - - - - -
-

$title$

-
- -$if(toc)$ -
-$if(toc-title)$ -

$toc-title$

-$endif$ -$table-of-contents$ -
-$endif$ - -$body$ - - - diff --git a/templates/pdf.html b/templates/pdf.html index eb78193..c3648c3 100644 --- a/templates/pdf.html +++ b/templates/pdf.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block content %} - + {% endblock %} {% block footer %} diff --git a/templates/preview.html b/templates/preview.html new file mode 100644 index 0000000..1177b2e --- /dev/null +++ b/templates/preview.html @@ -0,0 +1,18 @@ + + + + + + + {{ name }} + + +
+

{{ name }}

+
+ +
+
{{ pad_content }}
+
+ +