From 90aae529d705d909dbac5cb236cc9d2c77117935 Mon Sep 17 00:00:00 2001 From: John Haverlack Date: Thu, 5 Feb 2026 08:35:36 -0900 Subject: [PATCH] v1.1.0 Refactor --- .gitignore | 4 +- .obsidian/workspace.json | 10 +- conf/epub-metadata.xml | 8 -- conf/frontmatter_epub.md | 42 ------ conf/frontmatter_epub.xhtml | 25 ---- conf/metadata.yaml | 14 +- templates/epub_template.html | 1 + templates/metadata.yaml | 44 ++++++ templates/pandoc.yaml | 53 ++++++++ templates/style.css | 251 +++++++++++++++++++++++++++++++++++ templates/style_epub.css | 75 +++++++++++ 11 files changed, 440 insertions(+), 87 deletions(-) delete mode 100644 conf/epub-metadata.xml delete mode 100644 conf/frontmatter_epub.md delete mode 100644 conf/frontmatter_epub.xhtml create mode 100644 templates/epub_template.html create mode 100644 templates/metadata.yaml create mode 100644 templates/pandoc.yaml create mode 100644 templates/style.css create mode 100644 templates/style_epub.css diff --git a/.gitignore b/.gitignore index 4888bdc..d4d8f21 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ scripts/tmp scripts/deps -lib/mathjax \ No newline at end of file +lib/mathjax +conf/frontmatter* +conf/header.tex \ No newline at end of file diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index bab9964..32a9b50 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -271,17 +271,17 @@ }, "active": "9aca980657068944", "lastOpenFiles": [ + "templates/style_epub.css", + "templates/style.css", + "templates/pandoc.yaml", + "templates/metadata.yaml", + "templates/epub_template.html", "conf/sedYBewXK", "conf/sedEJ4vx7", "conf/sedhZUvts", "conf/sedX6LM6n", "conf/sedvTzKO0", "conf/sedlEPqb2", - "conf/sed1eOKK3", - "conf/sedXLODGr", - "conf/sedFPuOSH", - "conf/sedkL7Ngv", - "conf/sedtMLy1q", "chapters/AppendixA.md", "chapters/00_Introduction.md", "build/html/lib/img/unit-circle-with-tau.png", diff --git a/conf/epub-metadata.xml b/conf/epub-metadata.xml deleted file mode 100644 index 80c9b9f..0000000 --- a/conf/epub-metadata.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - Paths to Perception - John Haverlack - © 2005–2025 John Haverlack — CC BY-ND 4.0 - en - 2025-10-31 - diff --git a/conf/frontmatter_epub.md b/conf/frontmatter_epub.md deleted file mode 100644 index fc4329a..0000000 --- a/conf/frontmatter_epub.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: "Paths to Perception" -author: "John Haverlack" -rights: "© 2005–2025 John Haverlack — CC BY-ND 4.0" -epub:titlepage: true ---- - -
- -

Paths to Perception

-

A model of emergent reality

- -
- Cover illustration -
- -

John Haverlack

-

© 2005–2025 — CC BY-ND 4.0

- -
- -
- -
- Revolving Circles illusion -
- “Revolving Circles.” Wikipedia. Accessed Oct 31, 2025. -
-
- -

- The cover image presents an optical illusion of motion. When you focus on the - central point and move the page toward or away from your eyes, the concentric - circles appear to rotate. Perception shapes experience; we do not directly know - reality — our minds construct it. -

- -
diff --git a/conf/frontmatter_epub.xhtml b/conf/frontmatter_epub.xhtml deleted file mode 100644 index 8716631..0000000 --- a/conf/frontmatter_epub.xhtml +++ /dev/null @@ -1,25 +0,0 @@ - -
- -

Paths to Perception

-

A model of emergent reality

- - Cover illustration - -

John Haverlack

-

© 2005–2025 — CC BY-ND 4.0

-
- -
- - Revolving Circles illusion - -

- The cover image presents an optical illusion of motion. - Perception shapes experience. Our minds construct reality. -

-
diff --git a/conf/metadata.yaml b/conf/metadata.yaml index 2788d75..4be088c 100644 --- a/conf/metadata.yaml +++ b/conf/metadata.yaml @@ -4,7 +4,13 @@ subtitle: "A Pandoc template for building books and articles" name: "basic-book-builder" logo: "lib/img/UAF-ACEP.png" -# Idnetifiers +# Version / Repo +version: "1.1.0" +date: "2026-02-04" +state: "BETA" +source: "https://github.com/jehaverlack/basic-book-builder" + +# Identifiers doi: "UNSPECIFIED" isbn-pdf: "UNSPECIFIED" isbn-epub: "UNSPECIFIED" @@ -35,8 +41,4 @@ license-os-url: "https://creativecommons.org/licenses/by-nd/4.0/" license-com: "All Rights Reserved." license-com-text: "No part of the EPUB or printed editions may be reproduced or redistributed without permission." -# Version / Repo -version: "1.1.0" -date: "2026-02-04" -state: "BETA" -source: "https://github.com/jehaverlack/basic-book-builder" + diff --git a/templates/epub_template.html b/templates/epub_template.html new file mode 100644 index 0000000..36d66c2 --- /dev/null +++ b/templates/epub_template.html @@ -0,0 +1 @@ +$body$ diff --git a/templates/metadata.yaml b/templates/metadata.yaml new file mode 100644 index 0000000..4be088c --- /dev/null +++ b/templates/metadata.yaml @@ -0,0 +1,44 @@ +# Title +title: "Basic Book Builder" +subtitle: "A Pandoc template for building books and articles" +name: "basic-book-builder" +logo: "lib/img/UAF-ACEP.png" + +# Version / Repo +version: "1.1.0" +date: "2026-02-04" +state: "BETA" +source: "https://github.com/jehaverlack/basic-book-builder" + +# Identifiers +doi: "UNSPECIFIED" +isbn-pdf: "UNSPECIFIED" +isbn-epub: "UNSPECIFIED" +isbn-kindle: "UNSPECIFIED" +isbn-paperback: "UNSPECIFIED" +isbn-hardcover: "UNSPECIFIED" +isbn-audiobook: "UNSPECIFIED" + +# Publisher and Author +publisher: "University of Alaska Fairbanks" + +author: "John Haverlack" +author-email: "jehaverlack@alaska.edu" +affiliation: "Alaska Center for Energy and Power" +institution: "University of Alaska Fairbanks" + +# Copyright +copyright: "© 2026 Alaska Center for Energy and Power" + +# License +license: "CC BY-ND 4.0" +license-name: "Creative Commons Attribution-NoDerivatives 4.0 International License" +# Open Source License +license-os: "CC BY-ND 4.0" +license-os-text: "Creative Commons Attribution-NoDerivatives 4.0 International License" +license-os-url: "https://creativecommons.org/licenses/by-nd/4.0/" +# Commercial License +license-com: "All Rights Reserved." +license-com-text: "No part of the EPUB or printed editions may be reproduced or redistributed without permission." + + diff --git a/templates/pandoc.yaml b/templates/pandoc.yaml new file mode 100644 index 0000000..1e9ce96 --- /dev/null +++ b/templates/pandoc.yaml @@ -0,0 +1,53 @@ +# pandoc.yaml +input-files: + - chapters/Preface.md + - chapters/00_Introduction.md + - chapters/01_Getting_Started.md + # - chapters/02_Features.md + # - chapters/Terminology.md + # - chapters/Citations.md + - chapters/Appendix.md + - chapters/AppendixA.md + - chapters/Glossary.md + - chapters/Index.md + - chapters/Bibliography.md + +from: markdown+yaml_metadata_block+raw_tex +standalone: true + + +metadata: + mainfont: "Noto Serif" + sansfont: "Noto Sans" + monofont: "Noto Sans Mono" + # mainfont: "Libertinus Serif" + # sansfont: "Libertinus Sans" + # monofont: "DejaVu Sans Mono" + date: "" # <-- forces maketitle to exist, but blank + link-citations: true + +variables: + documentclass: book + fontsize: 12pt + geometry: + - margin=1in + toc: true # ✅ Pandoc-recognized variable + toc-depth: 3 # ✅ nested inside variables + toc-title: "Contents" # ✅ controls TOC heading + numbersections: true # ✅ correct key (not number-sections) + colorlinks: true # nice PDF hyperlinks + linkcolor: blue + graphics: true + float: false + figure-latex-placement: H + # suppress-chapter: true + +resource-path: + - . + - lib/img + - lib/diag + +citeproc: true +bibliography: lib/zotero.bib + + diff --git a/templates/style.css b/templates/style.css new file mode 100644 index 0000000..fee5730 --- /dev/null +++ b/templates/style.css @@ -0,0 +1,251 @@ +/* ------------------------------ + Base book typography + ------------------------------ */ + +body { + font-family: "Libertinus Serif", Georgia, serif; + max-width: 42em; + margin: auto; + padding: 3rem 1.25rem; + line-height: 1.65; + background: #fff; + color: #111; +} + +/* ------------------------------ + Headings + ------------------------------ */ + +h1, h2, h3, h4 { + font-family: "Libertinus Sans", sans-serif; + font-weight: 600; +} + +h1 { + font-size: 2.1rem; +} + +h1.titlepage { + border-bottom: 2px solid #ddd; + padding-bottom: 0.4rem; + margin-top: 2em; + margin-bottom: 0.6em; +} + +h1.title { + display: none; +} + +h2 { + font-size: 1.6rem; +} + +h3 { + font-size: 1.25rem; +} + +/* ------------------------------ + Front matter page + ------------------------------ */ + +.frontmatter { + text-align: center; + margin-top: 10vh; +} + +.frontmatter img { + max-width: 30%; + margin: 2rem auto; + display: block; +} + +/* ------------------------------ + Lists / paragraphs + ------------------------------ */ + +p { + margin: 1em 0; +} + +ul, ol { + padding-left: 1.5em; + margin: 1em 0; +} + +/* ------------------------------ + Math block spacing + ------------------------------ */ + +.math.display { + margin: 1.2em 0; +} + +/* ------------------------------ + Callouts (final tuned spacing) + ------------------------------ */ + +.callout-established, +.callout-proposed, +.callout-speculative, +.callout-caution, +.callout-warning, +.callout-danger { + border-radius: 6px; + padding: 5px; /* internal padding */ + margin-top: 5px; /* external spacing tightened */ + margin-bottom: 5px; + border-left: 6px solid; + background: #fefefe; +} + +/* Title line */ +.callout-established p:first-child strong, +.callout-proposed p:first-child strong, +.callout-speculative p:first-child strong, +.callout-caution p:first-child strong, +.callout-warning p:first-child strong, +.callout-danger p:first-child strong { + display: block; + font-family: "Libertinus Sans", sans-serif; + font-weight: 600; + font-size: 1.05rem; + margin-bottom: 5px; +} + +/* Paragraphs inside callouts */ +.callout-established p, +.callout-proposed p, +.callout-speculative p, +.callout-caution p, +.callout-warning p, +.callout-danger p { + margin-top: 5px; + margin-bottom: 5px; + line-height: 1.45; /* slightly condensed text spacing */ +} + +/* Remove top margin on first paragraph, bottom on last */ +.callout-established p:first-child, +.callout-proposed p:first-child, +.callout-speculative p:first-child, +.callout-caution p:first-child, +.callout-warning p:first-child, +.callout-danger p:first-child { + margin-top: 0; +} +.callout-established p:last-child, +.callout-proposed p:last-child, +.callout-speculative p:last-child, +.callout-caution p:last-child, +.callout-warning p:last-child, +.callout-danger p:last-child { + margin-bottom: 0; +} + +/* Math inside callouts */ +.callout-established .math.display, +.callout-proposed .math.display, +.callout-speculative .math.display, +.callout-caution .math.display, +.callout-warning .math.display, +.callout-danger .math.display { + margin: 0.4em 0; +} + +/* Colors */ +.callout-established { + background: #e8f7e8; + border-left-color: #3a8d3a; +} +.callout-proposed { + background: #e8f0ff; + border-left-color: #3b6dd8; +} +.callout-speculative { + background: #f7e8ff; + border-left-color: #8b2be2; +} + +.callout-caution { + background: #fff0e8; + border-left-color: #f5a22f; +} + +.callout-warning { + background: #fff0e8; + border-left-color: #f5a22f; +} + +.callout-danger { + background: #ffe8e8; + border-left-color: #d83b3a; +} + +/* ------------------------------ + Images (in body content) + ------------------------------ */ + +img { + max-width: 100%; + display: block; + margin: 1.2em auto; +} + +/* ------------------------------ + Blockquotes (normal ones) + ------------------------------ */ + +blockquote { + border-left: 4px solid #ccc; + padding-left: 1em; + font-style: italic; + color: #444; +} + +/* ------------------------------ + Horizontal rule + ------------------------------ */ + +hr { + margin: 3rem 0; + border: none; + border-top: 1px solid #ddd; +} + +/* ------------------------------ + Code (rare in your book) + ------------------------------ */ + +code { + background: #f3f3f3; + padding: 0.1em 0.3em; + border-radius: 4px; + font-size: 0.95em; +} + +/* Force all header cells to left-align their text */ +table thead th { + text-align: left !important; + vertical-align: bottom; /* optional: aligns nicely with text baseline */ + padding: 4px 8px; /* optional: consistent spacing */ +} + +/* Make data cells match if you want consistent left alignment */ +table tbody td { + text-align: left; + padding: 4px 8px; +} + +/* Optional: keep math inline nicely aligned */ +table td .math, +table th .math { + display: inline-block; + vertical-align: baseline; +} + +/* Optional: make math display nicely aligned */ +table td .math.display, +table th .math.display { + display: block; + margin: 0.4em 0; +} diff --git a/templates/style_epub.css b/templates/style_epub.css new file mode 100644 index 0000000..c511547 --- /dev/null +++ b/templates/style_epub.css @@ -0,0 +1,75 @@ +/* Safer defaults for varied EPUB engines (Kindle, iBooks, KOReader, etc.) */ + +html, body { + margin: 0; + padding: 0.8em; + line-height: 1.55; + widows: 2; + orphans: 2; +} + +/* Avoid fonts that may not exist on the device */ +body { + font-family: serif; + color: #111; +} + +/* Headings */ +h1, h2, h3 { + font-family: serif; + font-weight: 700; + margin: 1.2em 0 0.5em 0; +} + +h1 { font-size: 1.6em; } +h2 { font-size: 1.3em; } +h3 { font-size: 1.1em; } + +/* Lists and paragraphs */ +p { margin: 0.7em 0; } +ul, ol { margin: 0.7em 0 0.7em 1.2em; } + +/* Images */ +img { max-width: 100%; height: auto; } + +/* Page breaks for supported readers */ +section[epub|type="titlepage"] { + break-after: page; + page-break-after: always; /* fallback */ +} +section#pubmeta { + break-after: page; + page-break-after: always; +} + +/* Callouts (match HTML look, keep it minimal for EPUB) */ +.callout-established, +.callout-proposed, +.callout-speculative { + padding: 0.6em; + margin: 0.7em 0; + border-left: 0.35em solid; + background: #fefefe; +} + +.callout-established { border-color: #3a8d3a; background: #e8f7e8; } +.callout-proposed { border-color: #3b6dd8; background: #e8f0ff; } +.callout-speculative { border-color: #8b2be2; background: #f7e8ff; } + +/* First bold line inside a callout = title */ +.callout-established p:first-child strong, +.callout-proposed p:first-child strong, +.callout-speculative p:first-child strong { + display: block; + margin-bottom: 0.3em; +} + +/* Math (MathML) spacing */ +.math.display { margin: 0.8em 0; } + +/* Blockquotes */ +blockquote { + border-left: 0.25em solid #bbb; + padding-left: 0.8em; + color: #444; +}