diff --git a/Makefile b/Makefile
index ab26d7f..c4b836b 100644
--- a/Makefile
+++ b/Makefile
@@ -24,3 +24,6 @@ livehtml:
upload:
cp -r _build/html '/home/runassudo/Documents/Work/School Cloud Data/unenc/public/www/pointsoforder'
+ sha256sum _build/latex/PointsOfOrder_Print.pdf | awk '{print substr($$1,0,6);}' > _build/latex/PointsOfOrder_Print.pdf.sha256
+ rm '/home/runassudo/Documents/Work/School Cloud Data/unenc_transient/Lulu/PointsOfOrder_Print'*.pdf
+ cp _build/latex/PointsOfOrder_Print.pdf '/home/runassudo/Documents/Work/School Cloud Data/unenc_transient/Lulu/PointsOfOrder_Print_'$$(sha256sum _build/latex/PointsOfOrder_Print.pdf | awk '{print substr($$1,0,6);}')'.pdf'
diff --git a/_static/cover.jpg b/_static/cover.jpg
new file mode 100644
index 0000000..ace16d5
Binary files /dev/null and b/_static/cover.jpg differ
diff --git a/_static/custom.css b/_static/custom.css
index 81c992e..65e9892 100644
--- a/_static/custom.css
+++ b/_static/custom.css
@@ -1,71 +1,3 @@
-/* Fonts */
-
-@font-face {
- font-family: 'SansParaSymbol';
- src: local('FreeSans'), local('Helvetica'), local('Arial'), local('sans-serif');
- unicode-range: U+B6;
-}
-
-@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:ital,wght@0,400;0,600;1,400&family=Source+Sans+Pro:ital,wght@0,400;0,600;1,400;1,600&display=swap');
-
-body {
- font-family: SansParaSymbol, 'IBM Plex Serif', serif;
-}
-
-div.body h1, div.body h2, div.body h3, div.body h4, div.body h5, div.body h6 {
- font-family: 'Source Sans Pro', sans-serif;
- font-weight: 600;
-}
-
-div.sphinxsidebarwrapper h1.logo {
- font-weight: 600;
-}
-
-a.headerlink {
- font-family: SansParaSymbol, sans-serif;
-}
-
-/* Paragraph numbers */
-
-div.body p {
- position: relative;
-}
-
-span.paragraph-num {
- width: 3rem;
- position: absolute;
- left: -3.5rem;
- padding-right: 1rem; /* For mouseover bounding box */
-
- text-align: right;
- font-size: 0.8rem;
-
- visibility: hidden;
-}
-
-span.paragraph-num a {
- color: #aaa;
- text-decoration: none;
-}
-span.paragraph-num a:hover {
- border-bottom: 1px solid #aaa;
-}
-
-span.paragraph-num a::before {
- content: '¶';
- font-family: SansParaSymbol, sans-serif;
-}
-
-p:hover span.paragraph-num {
- visibility: visible;
-}
-
-/* Remove underlining from links */
-
-a, a.reference, a.footnote-reference {
- border-bottom: none;
-}
-
/* Footnote styling in text */
a.footnote-reference {
@@ -94,33 +26,3 @@ dl.footnote span.brackets:not(:last-child)::before {
dl.footnote span.brackets:not(:last-child)::after {
content: ']';
}
-
-/* Sidebar */
-
-div.sphinxsidebarwrapper p.caption {
- display: none;
-}
-
-/* Media queries */
-
-@media screen and (max-width: 870px) {
- /* Override narrow window list formatting */
-
- ul {
- margin-left: 30px;
- }
-
- /* Paragraph numbers */
-
- span.paragraph-num {
- left: -3.2rem;
- }
-}
-
-@media screen and (max-width: 875px) {
- /* Sidebar text colour */
-
- div.sphinxsidebar ul {
- color: #fff;
- }
-}
diff --git a/_static/custom_epub.css b/_static/custom_epub.css
new file mode 100644
index 0000000..d54fde3
--- /dev/null
+++ b/_static/custom_epub.css
@@ -0,0 +1,24 @@
+/* Paragraph numbers */
+
+span.paragraph-num a {
+ text-decoration: none;
+}
+
+span.paragraph-num a::before {
+ content: '[';
+}
+span.paragraph-num a::after {
+ content: '] ';
+}
+
+/* Remove underlining from links */
+
+a.footnote-reference {
+ text-decoration: none;
+}
+
+/* Table formatting */
+
+table.docutils td, table.docutils th {
+ border-top: 1px solid #aaa;
+}
diff --git a/_static/custom_html.css b/_static/custom_html.css
new file mode 100644
index 0000000..3ea9cc9
--- /dev/null
+++ b/_static/custom_html.css
@@ -0,0 +1,97 @@
+/* Fonts */
+
+@font-face {
+ font-family: 'SansParaSymbol';
+ src: local('FreeSans'), local('Helvetica'), local('Arial'), local('sans-serif');
+ unicode-range: U+B6;
+}
+
+@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Serif:ital,wght@0,400;0,600;1,400&family=Source+Sans+Pro:ital,wght@0,400;0,600;1,400;1,600&display=swap');
+
+body {
+ font-family: SansParaSymbol, 'IBM Plex Serif', serif;
+}
+
+div.body h1, div.body h2, div.body h3, div.body h4, div.body h5, div.body h6 {
+ font-family: 'Source Sans Pro', sans-serif;
+ font-weight: 600;
+}
+
+div.sphinxsidebarwrapper h1.logo {
+ font-weight: 600;
+}
+
+a.headerlink {
+ font-family: SansParaSymbol, sans-serif;
+}
+
+/* Paragraph numbers */
+
+div.body p {
+ position: relative;
+}
+
+span.paragraph-num {
+ width: 3rem;
+ position: absolute;
+ left: -3.5rem;
+ padding-right: 1rem; /* For mouseover bounding box */
+
+ text-align: right;
+ font-size: 0.8rem;
+
+ visibility: hidden;
+}
+
+span.paragraph-num a {
+ color: #aaa;
+ text-decoration: none;
+}
+span.paragraph-num a:hover {
+ border-bottom: 1px solid #aaa;
+}
+
+span.paragraph-num a::before {
+ content: '¶';
+ font-family: SansParaSymbol, sans-serif;
+}
+
+p:hover span.paragraph-num {
+ visibility: visible;
+}
+
+/* Remove underlining from links */
+
+a, a.reference, a.footnote-reference {
+ border-bottom: none;
+}
+
+/* Sidebar */
+
+div.sphinxsidebarwrapper p.caption {
+ display: none;
+}
+
+/* Media queries */
+
+@media screen and (max-width: 870px) {
+ /* Override narrow window list formatting */
+
+ ul {
+ margin-left: 30px;
+ }
+
+ /* Paragraph numbers */
+
+ span.paragraph-num {
+ left: -3.2rem;
+ }
+}
+
+@media screen and (max-width: 875px) {
+ /* Sidebar text colour */
+
+ div.sphinxsidebar ul {
+ color: #fff;
+ }
+}
diff --git a/_templates/epub-cover.html b/_templates/epub-cover.html
new file mode 100644
index 0000000..caa85ea
--- /dev/null
+++ b/_templates/epub-cover.html
@@ -0,0 +1,35 @@
+{#
+ epub/epub-cover.html
+ ~~~~~~~~~~~~~~~~~~~~
+
+ Sample template for the html cover page.
+
+ :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
+#}
+{%- extends "layout.html" %}
+{%- block header %}{% endblock %}
+{%- block rootrellink %}{% endblock %}
+{%- block relbaritems %}{% endblock %}
+{%- block sidebarlogo %}{% endblock %}
+{%- block linktags %}{% endblock %}
+{%- block relbar1 %}{% endblock %}
+{%- block sidebar1 %}{% endblock %}
+{%- block sidebar2 %}{% endblock %}
+{%- block footer %}{% endblock %}
+
+{% block content %}
+
+

+
+
+{% endblock %}
diff --git a/conf.py b/conf.py
index 74df8b0..5f63fc3 100644
--- a/conf.py
+++ b/conf.py
@@ -23,6 +23,7 @@ author = 'Lee Yingtong Li'
# The full version, including alpha/beta/rc tags
release = '0.2'
+version = release
# -- General configuration ---------------------------------------------------
@@ -55,9 +56,9 @@ html_title = 'Points of Order'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
-html_theme = 'alabaster'
-#html_theme = 'theme'
-#html_theme_path = ['.']
+#html_theme = 'alabaster'
+html_theme = 'potheme_html'
+html_theme_path = ['.']
html_sidebars = {'*': ['about.html', 'navigation.html', 'searchbox.html']}
# Add any paths that contain custom static files (such as style sheets) here,
@@ -65,9 +66,9 @@ html_sidebars = {'*': ['about.html', 'navigation.html', 'searchbox.html']}
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
-#html_css_files = [
-# 'custom.css',
-#]
+html_css_files = ['custom_html.css'] # custom.css automatically included by alabaster
+
+html_extra_path = ['epub-cover.xhtml', 'epub-copyright.xhtml']
html_copy_source = False
@@ -76,13 +77,27 @@ html_copy_source = False
latex_engine = 'lualatex'
latex_elements = {
+ 'passoptionstopackages': r'\input{pass-options.tex.txt}',
'preamble': r'\input{preamble.tex.txt}',
#'geometry': r'\usepackage[paperwidth=6in,paperheight=9in,margin=0.5in,bottom=0.75in,inner=0.75in]{geometry}',
- 'geometry': r'\usepackage[paperwidth=5.5in,paperheight=9in,margin=0.5in,bottom=0.75in,inner=0.5in]{geometry}',
+ #'geometry': r'\usepackage[paperwidth=5.5in,paperheight=9in,margin=0.5in,bottom=0.75in,inner=0.5in]{geometry}',
'sphinxsetup': r'AtStartFootnote={},OuterLinkColor={rgb}{0.208,0.374,0.486}',
'papersize': 'a4paper',
'pointsize': '12pt',
'releasename': 'Edition',
}
-latex_additional_files = ['preamble.tex.txt']
+latex_additional_files = ['pass-options.tex.txt', 'preamble.tex.txt']
#latex_show_pagerefs = True
+
+latex_documents = [
+ ('index', 'PointsOfOrder_Web.tex', 'Points of Order', '', 'manual'),
+ ('index', 'PointsOfOrder_Print.tex', 'Points of Order', '', 'manual'),
+]
+
+
+# -- Options for EPUB output -------------------------------------------------
+
+epub_cover = ('_static/cover.jpg', '')
+epub_pre_files = [('epub-cover.xhtml', ''), ('epub-copyright.xhtml', '')]
+epub_css_files = ['custom.css', 'custom_epub.css']
+epub_show_urls = 'no'
diff --git a/epub-copyright.xhtml b/epub-copyright.xhtml
new file mode 100644
index 0000000..8f12797
--- /dev/null
+++ b/epub-copyright.xhtml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ Points of Order
+
+
+
+
+
+ Edition 0.1 first published 2018
+ Edition 0.2 first published 2021
+ https://yingtongli.me/pointsoforder
+ Copyright © 2021 Lee Yingtong Li. You may use this book, at your option, under either of the following licences:
+
+ Authored in Sphinx
+ Cover image courtesy of Breather Products Inc., licensed under the Creative Commons CC0 1.0 Universal Public Domain Dedication
+
+
diff --git a/epub-cover.xhtml b/epub-cover.xhtml
new file mode 100644
index 0000000..1ccbe61
--- /dev/null
+++ b/epub-cover.xhtml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+ Points of Order
+
+
+
+
+
+
+

+
+
+
diff --git a/extension.py b/extension.py
index 6766015..2ad1dad 100644
--- a/extension.py
+++ b/extension.py
@@ -7,6 +7,7 @@
def setup(app):
app.add_builder(POStandaloneHTMLBuilder, override=True)
app.add_builder(POLaTeXBuilder, override=True)
+ app.add_builder(POEpub3Builder, override=True)
app.add_role('subref', SubRefRole())
@@ -107,6 +108,13 @@ class POLaTeXTranslator(LaTeXTranslator):
class POLaTeXBuilder(LaTeXBuilder):
default_translator_class = POLaTeXTranslator
+# Epub3 Builder
+
+from sphinx.builders.epub3 import Epub3Builder
+
+class POEpub3Builder(Epub3Builder):
+ default_translator_class = POHTML5Translator
+
# :subref: Role
from sphinx.roles import XRefRole
diff --git a/introduction.rst b/introduction.rst
index 499dc1f..beb0a8e 100644
--- a/introduction.rst
+++ b/introduction.rst
@@ -32,7 +32,7 @@ It is suitable for Chairs of committees and organisations as a reference text on
It is also suitable, if desired, to be referred to in an organisation's rules as an authority on meeting procedure to resolve disputes that arise.
-.. only:: html
+.. only:: builder_html
Copyright
---------
diff --git a/pass-options.tex.txt b/pass-options.tex.txt
new file mode 100644
index 0000000..12f5e9f
--- /dev/null
+++ b/pass-options.tex.txt
@@ -0,0 +1,11 @@
+% Colours/formatting by output mode
+\newif\ifpoprint\poprintfalse
+\makeatletter
+\edef\@tempa{\jobname}
+\def\@tempb{PointsOfOrder_Print}
+\@onelevel@sanitize\@tempb % https://tex.stackexchange.com/questions/243591/comparing-strings-extracted-from-jobname
+\ifx\@tempa\@tempb % Compare \jobname with "PointsOfOrder_Print"
+ \poprinttrue
+ \PassOptionsToPackage{cmyk}{xcolor}
+\fi
+\makeatother
diff --git a/_templates/layout.html b/potheme_html/layout.html
similarity index 100%
rename from _templates/layout.html
rename to potheme_html/layout.html
diff --git a/_templates/navigation.html b/potheme_html/navigation.html
similarity index 100%
rename from _templates/navigation.html
rename to potheme_html/navigation.html
diff --git a/_templates/relations.html b/potheme_html/relations.html
similarity index 100%
rename from _templates/relations.html
rename to potheme_html/relations.html
diff --git a/potheme_html/theme.conf b/potheme_html/theme.conf
new file mode 100644
index 0000000..cca932a
--- /dev/null
+++ b/potheme_html/theme.conf
@@ -0,0 +1,2 @@
+[theme]
+inherit = alabaster
diff --git a/preamble.tex.txt b/preamble.tex.txt
index a434d9c..29cf1c7 100644
--- a/preamble.tex.txt
+++ b/preamble.tex.txt
@@ -1,8 +1,6 @@
% Typographic improvements
\usepackage{microtype}
-%\usepackage[pdfencoding=pdfdoc]{hyperref}
-
% Disable numbering of body headings
\setcounter{secnumdepth}{0}
@@ -17,6 +15,18 @@
\setsansfont{Source Sans Pro}[BoldFont={* Semibold},BoldItalicFont={* Semibold Italic}]
\usepackage{newunicodechar}\newfontface{\libserif}{Liberation Serif}\newunicodechar{¶}{{\libserif ¶\hspace{0.1ex}}} % use filled in ¶
+% Colours/formatting by output mode
+\ifpoprint
+ \definecolor{TitleColor}{cmyk}{0,0,0,1}
+ \definecolor{InnerLinkColor}{cmyk}{0,0,0,1}
+ \definecolor{OuterLinkColor}{cmyk}{0,0,0,1}
+ \geometry{paperwidth=6in,paperheight=9in,margin=0.5in,bottom=0.75in,inner=0.625in} % Add bleed, gutter, etc.
+ %\usepackage[width=6.25truein,height=9.25truein,center,cam,noinfo]{crop}
+ \usepackage[width=6.25truein,height=9.25truein,center,noinfo]{crop} % No crop marks for Lulu
+\else
+ \geometry{paperwidth=5.875in,paperheight=9in,margin=0.5in,bottom=0.75in,inner=0.5in} % Deduct 0.125in from width to account for gutter
+\fi
+
% Footnote style
\usepackage[hang,bottom]{footmisc}
\setlength{\footnotemargin}{0.4cm}
@@ -33,9 +43,14 @@
% Back of title page content
\newcommand{\sphinxbackoftitlepage}{
- \begingroup\scriptsize
+ \begingroup\footnotesize
+ Edition 0.1 first published 2018 \\
Edition 0.2 first published 2021
+ \vspace{1cm}
+
+ \sphinxhref{https://yingtongli.me/pointsoforder}{https://yingtongli.me/pointsoforder}
+
\vspace*{\fill}
Copyright © 2021 Lee Yingtong Li. You may use this book, at your option, under either of the following licences:
@@ -44,7 +59,13 @@
\item the \sphinxhref{https://www.gnu.org/licenses/fdl-1.3.en.html}{GNU Free Documentation License, version 1.3}
\end{itemize}}
- Typeset using \LaTeX{} in EB Garamond 12pt
+ Authored in \sphinxhref{https://www.sphinx-doc.org/}{Sphinx} and typeset using \LaTeX{} in EB Garamond 12pt and Source Sans Pro
+
+ \ifpoprint
+ Cover image courtesy of Breather Products Inc., licensed under the \sphinxhref{https://creativecommons.org/publicdomain/zero/1.0/}{Creative Commons CC0 1.0 Universal Public Domain Dedication}
+
+ Printed by Lulu Press
+ \fi
\endgroup
}
@@ -66,12 +87,12 @@
\begingroup % for PDF information dictionary
\def\endgraf{ }\def\and{\& }%
\pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup
- \hypersetup{pdfauthor={\@author}, pdftitle={\@title}}%
+ \hypersetup{pdfauthor={\@author}, pdftitle={Points of Order}}%
\endgroup
\begin{flushright}%
\sphinxlogo
\py@HeaderFamily
- {\Huge \@title \\\vspace{0.2cm}\normalfont\sffamily\LARGE Meeting procedure in Australia and the UK\vspace{0.5cm} \par} % ADD SUBHEADING
+ {\Huge Points of Order \\\vspace{0.2cm}\normalfont\sffamily\LARGE Meeting procedure in Australia and the UK\vspace{0.5cm} \par} % ADD SUBHEADING
{\itshape\LARGE \py@release\releaseinfo \par}
\vfill
{\LARGE