Workflow mods for PDF and EPUB output

This commit is contained in:
RunasSudo 2021-02-10 17:34:38 +11:00
parent 7f76b5988f
commit c33b6d931a
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
17 changed files with 270 additions and 113 deletions

View File

@ -24,3 +24,6 @@ livehtml:
upload: upload:
cp -r _build/html '/home/runassudo/Documents/Work/School Cloud Data/unenc/public/www/pointsoforder' 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'

BIN
_static/cover.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

View File

@ -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 */ /* Footnote styling in text */
a.footnote-reference { a.footnote-reference {
@ -94,33 +26,3 @@ dl.footnote span.brackets:not(:last-child)::before {
dl.footnote span.brackets:not(:last-child)::after { dl.footnote span.brackets:not(:last-child)::after {
content: ']'; 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;
}
}

24
_static/custom_epub.css Normal file
View File

@ -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;
}

97
_static/custom_html.css Normal file
View File

@ -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;
}
}

View File

@ -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 %}
<div class="epub-cover">
<img src="{{ image }}" alt="Cover image" />
</div>
<div>
<p>Edition 0.1 first published 2018<br>
Edition 0.2 first published 2021</p>
<p><a href="https://yingtongli.me/pointsoforder">https://yingtongli.me/pointsoforder</a></p>
<p>Copyright © 2021 Lee Yingtong Li. You may use this book, at your option, under either of the following licences:
<ul><li>the <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International licence</a></li>
<li>the <a href="https://www.gnu.org/licenses/fdl-1.3.en.html">GNU Free Documentation License, version 1.3</a></li></ul></p>
<p>Authored in <a href="https://www.sphinx-doc.org/">Sphinx</a></p>
<p>Cover image courtesy of Breather Products Inc., licensed under the <a href="https://creativecommons.org/publicdomain/zero/1.0/">Creative Commons CC0 1.0 Universal Public Domain Dedication</a></p>
</div>
{% endblock %}

31
conf.py
View File

@ -23,6 +23,7 @@ author = 'Lee Yingtong Li'
# The full version, including alpha/beta/rc tags # The full version, including alpha/beta/rc tags
release = '0.2' release = '0.2'
version = release
# -- General configuration --------------------------------------------------- # -- 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 # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
# #
html_theme = 'alabaster' #html_theme = 'alabaster'
#html_theme = 'theme' html_theme = 'potheme_html'
#html_theme_path = ['.'] html_theme_path = ['.']
html_sidebars = {'*': ['about.html', 'navigation.html', 'searchbox.html']} html_sidebars = {'*': ['about.html', 'navigation.html', 'searchbox.html']}
# Add any paths that contain custom static files (such as style sheets) here, # 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". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static'] html_static_path = ['_static']
#html_css_files = [ html_css_files = ['custom_html.css'] # custom.css automatically included by alabaster
# 'custom.css',
#] html_extra_path = ['epub-cover.xhtml', 'epub-copyright.xhtml']
html_copy_source = False html_copy_source = False
@ -76,13 +77,27 @@ html_copy_source = False
latex_engine = 'lualatex' latex_engine = 'lualatex'
latex_elements = { latex_elements = {
'passoptionstopackages': r'\input{pass-options.tex.txt}',
'preamble': r'\input{preamble.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=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}', 'sphinxsetup': r'AtStartFootnote={},OuterLinkColor={rgb}{0.208,0.374,0.486}',
'papersize': 'a4paper', 'papersize': 'a4paper',
'pointsize': '12pt', 'pointsize': '12pt',
'releasename': 'Edition', 'releasename': 'Edition',
} }
latex_additional_files = ['preamble.tex.txt'] latex_additional_files = ['pass-options.tex.txt', 'preamble.tex.txt']
#latex_show_pagerefs = True #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'

22
epub-copyright.xhtml Normal file
View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Points of Order</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/epub.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/custom.css" />
<link rel="stylesheet" type="text/css" href="_static/custom_epub.css" />
</head><body>
<p>Edition 0.1 first published 2018<br>
Edition 0.2 first published 2021</p>
<p><a href="https://yingtongli.me/pointsoforder">https://yingtongli.me/pointsoforder</a></p>
<p>Copyright © 2021 Lee Yingtong Li. You may use this book, at your option, under either of the following licences:
<ul><li>the <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International licence</a></li>
<li>the <a href="https://www.gnu.org/licenses/fdl-1.3.en.html">GNU Free Documentation License, version 1.3</a></li></ul></p>
<p>Authored in <a href="https://www.sphinx-doc.org/">Sphinx</a></p>
<p>Cover image courtesy of Breather Products Inc., licensed under the <a href="https://creativecommons.org/publicdomain/zero/1.0/">Creative Commons CC0 1.0 Universal Public Domain Dedication</a></p>
</body>
</html>

17
epub-cover.xhtml Normal file
View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Points of Order</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/epub.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/custom.css" />
<link rel="stylesheet" type="text/css" href="_static/custom_epub.css" />
</head><body>
<div class="epub-cover">
<img src="_static/cover.jpg" alt="Cover image" />
</div>
</body>
</html>

View File

@ -7,6 +7,7 @@
def setup(app): def setup(app):
app.add_builder(POStandaloneHTMLBuilder, override=True) app.add_builder(POStandaloneHTMLBuilder, override=True)
app.add_builder(POLaTeXBuilder, override=True) app.add_builder(POLaTeXBuilder, override=True)
app.add_builder(POEpub3Builder, override=True)
app.add_role('subref', SubRefRole()) app.add_role('subref', SubRefRole())
@ -107,6 +108,13 @@ class POLaTeXTranslator(LaTeXTranslator):
class POLaTeXBuilder(LaTeXBuilder): class POLaTeXBuilder(LaTeXBuilder):
default_translator_class = POLaTeXTranslator default_translator_class = POLaTeXTranslator
# Epub3 Builder
from sphinx.builders.epub3 import Epub3Builder
class POEpub3Builder(Epub3Builder):
default_translator_class = POHTML5Translator
# :subref: Role # :subref: Role
from sphinx.roles import XRefRole from sphinx.roles import XRefRole

View File

@ -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. 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 Copyright
--------- ---------

11
pass-options.tex.txt Normal file
View File

@ -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

2
potheme_html/theme.conf Normal file
View File

@ -0,0 +1,2 @@
[theme]
inherit = alabaster

View File

@ -1,8 +1,6 @@
% Typographic improvements % Typographic improvements
\usepackage{microtype} \usepackage{microtype}
%\usepackage[pdfencoding=pdfdoc]{hyperref}
% Disable numbering of body headings % Disable numbering of body headings
\setcounter{secnumdepth}{0} \setcounter{secnumdepth}{0}
@ -17,6 +15,18 @@
\setsansfont{Source Sans Pro}[BoldFont={* Semibold},BoldItalicFont={* Semibold Italic}] \setsansfont{Source Sans Pro}[BoldFont={* Semibold},BoldItalicFont={* Semibold Italic}]
\usepackage{newunicodechar}\newfontface{\libserif}{Liberation Serif}\newunicodechar{¶}{{\libserif ¶\hspace{0.1ex}}} % use filled in ¶ \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 % Footnote style
\usepackage[hang,bottom]{footmisc} \usepackage[hang,bottom]{footmisc}
\setlength{\footnotemargin}{0.4cm} \setlength{\footnotemargin}{0.4cm}
@ -33,9 +43,14 @@
% Back of title page content % Back of title page content
\newcommand{\sphinxbackoftitlepage}{ \newcommand{\sphinxbackoftitlepage}{
\begingroup\scriptsize \begingroup\footnotesize
Edition 0.1 first published 2018 \\
Edition 0.2 first published 2021 Edition 0.2 first published 2021
\vspace{1cm}
\sphinxhref{https://yingtongli.me/pointsoforder}{https://yingtongli.me/pointsoforder}
\vspace*{\fill} \vspace*{\fill}
Copyright © 2021 Lee Yingtong Li. You may use this book, at your option, under either of the following licences: 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} \item the \sphinxhref{https://www.gnu.org/licenses/fdl-1.3.en.html}{GNU Free Documentation License, version 1.3}
\end{itemize}} \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 \endgroup
} }
@ -66,12 +87,12 @@
\begingroup % for PDF information dictionary \begingroup % for PDF information dictionary
\def\endgraf{ }\def\and{\& }% \def\endgraf{ }\def\and{\& }%
\pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup \pdfstringdefDisableCommands{\def\\{, }}% overwrite hyperref setup
\hypersetup{pdfauthor={\@author}, pdftitle={\@title}}% \hypersetup{pdfauthor={\@author}, pdftitle={Points of Order}}%
\endgroup \endgroup
\begin{flushright}% \begin{flushright}%
\sphinxlogo \sphinxlogo
\py@HeaderFamily \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} {\itshape\LARGE \py@release\releaseinfo \par}
\vfill \vfill
{\LARGE {\LARGE