This theme provides a Sphinx template that uses the pagedjs Javascript library to implement a few of the forthcoming CSS3 paged media directives for pdf pagination and headers/footers. It is based on the pandoc template for rstudio/pagedown.
It was created by Mara Colclough as part of the EOAS/UBC courseware project
An example build:
Formatted with page-breaks, page numbers and header information from the file headers.json
pip install git+https://github.com/eoas-ubc/paged_html_theme.git@master --upgrade
- 
or if you want to install the version you just cloned, do an editable install pip install -e . --upgrade
- 
clone the repository and cd to the directory git clone https://github.com/eoas-ubc/paged_html_theme.git cd paged_html_theme
- 
execute build_pageto build the example
build_page examples/page_break_test/test_file.md  \
  examples/page_break_test/headers.json 
- 
this will write: examples/page_break_test/_test_file_build/test_file.html
- 
Edit headers.jsonto change headers.
- 
if headers.json is missing from the command line and doesn't exist, a default version will be created 
- 
build_page --helpprints the docstring
- 
The print-specfic styling can be change by injecting new css styles into src/paged_html_theme/layout.html
- 
To modify the @media printcss- create the environment and activate
 cd paged_html_theme conda env create --name theme_dev --file environment.yml conda activate theme_dev- pip install in editable mode:
 pip install -e . --upgrade- 
edit src/scss/print_style.scss
- 
use inject_cssto buildprint_style.cssand inject intosrc/paged_hytml_theme/layout.html
 cd paged_html_theme inject_css `` 1. Reinstall `pip install . --upgrade`
- 
To insert a pagebreak, use <div class="page-break"></div>
- 
To change the page size, or the left and center header edit headers.json