Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/scripts/check_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""CI check of what `pixi run word` (and `pixi run pdf`) made.

python .github/scripts/check_output.py [concordia]
"""
import glob
import re
import sys
import zipfile

docx = glob.glob("_book/*.docx")
assert docx, "no Word file in _book/"
xml = zipfile.ZipFile(docx[0]).read("word/document.xml").decode()
print("Word file:", docx[0])

if "concordia" in sys.argv[1:]:
sections = re.findall(r"<w:sectPr.*?</w:sectPr>", xml, re.S)
found = []
for s in sections:
fmt = re.search(r'w:fmt="(\w+)"', s)
start = re.search(r'w:start="(\d+)"', s)
found.append((fmt.group(1) if fmt else "decimal", start.group(1) if start else None, "footerReference" in s))
expected = [("lowerRoman", "1", False), ("lowerRoman", "3", True), ("decimal", "1", True)]
assert found == expected, f"sections {found}, expected {expected}"
for text in ["SCHOOL OF GRADUATE STUDIES", "Abstract", "Table of Contents"]:
assert text in xml, f"front pages lack {text!r}"
print("Concordia sections: title/signature unnumbered, front pages from iii, chapters from 1")

pdfs = glob.glob("_book/*.pdf")
if pdfs:
data = open(pdfs[0], "rb").read()
assert re.search(rb"pdfaid:part(>|=\")2", data), "PDF isn't marked PDF/A-2"
print("PDF:", pdfs[0], "PDF/A-2")
48 changes: 40 additions & 8 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Check

# Builds the example thesis on Windows, macOS and Linux: pixi install, import
# the Word chapters, render the Word file. Runs only in the template itself,
# not in theses made from it.
# Builds the example thesis on Windows, macOS and Linux, plain and with the
# Concordia profile (doctoral everywhere, master's on Linux), and the PDF/A
# on Linux and Windows. Runs only in the template itself, not in theses made
# from it.
on:
push:
branches: [main]
Expand All @@ -16,6 +17,11 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
thesis: [plain, concordia-doctoral, concordia-masters]
exclude:
- { os: windows-latest, thesis: concordia-masters }
- { os: macos-latest, thesis: concordia-masters }
name: ${{ matrix.thesis }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -28,14 +34,40 @@ jobs:
- name: Import the Word chapters
run: pixi run import

- name: Render the thesis in the template
- name: Concordia profile
if: startsWith(matrix.thesis, 'concordia')
shell: bash
run: |
pixi run concordia
echo "QUARTO_PROFILE=concordia" >> "$GITHUB_ENV"

- name: Master's
if: matrix.thesis == 'concordia-masters'
shell: bash
run: |
sed -i.bak 's/^ degree-level: doctoral.*/ degree-level: masters/' _quarto-concordia.yml
grep -n 'degree-level' _quarto-concordia.yml

- name: Render the thesis
run: pixi run word

- name: The Word file was made
- name: LibreOffice (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libreoffice-writer

- name: LibreOffice (Windows)
if: runner.os == 'Windows'
run: choco install libreoffice-fresh -y --no-progress

- name: PDF/A
if: runner.os != 'macOS'
run: pixi run pdf

- name: Check what was made
shell: bash
run: ls -l _book/*.docx
run: pixi run python .github/scripts/check_output.py ${{ startsWith(matrix.thesis, 'concordia') && 'concordia' || '' }}

- uses: actions/upload-artifact@v4
with:
name: thesis-${{ matrix.os }}
path: _book/*.docx
name: ${{ matrix.thesis }}-${{ matrix.os }}
path: _book/*.*
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ _book/

/.quarto/
**/*.quarto_ipynb

# Built on your computer from Concordia's official template by `pixi run concordia`.
universities/concordia/reference.docx
universities/concordia/footer.txt
12 changes: 12 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ template.
| `pixi run import` | Converts each `word/*.docx` to a chapter, gathers citations into `references.json`, updates the chapter list in `_quarto.yml` |
| `pixi run word` | The whole thesis as one Word file in `template.docx`, in `_book/` |
| `pixi run preview` | A live preview in the browser |
| `pixi run pdf` | The Word file as PDF/A, contents and lists filled in (needs LibreOffice) |
| `pixi run concordia` | Once, for a Concordia thesis: builds `universities/concordia/reference.docx` from Concordia's official template |

## Moving their chapters in

Expand All @@ -43,6 +45,16 @@ template.
(Persian, Arabic, Hebrew), uncomment `lang` and `dir` there.
5. Run `pixi run word` and tell them where the file is.

## A Concordia University thesis

1. `pixi run concordia` (downloads Concordia's template; never commit what it builds).
2. Uncomment `profile: default: concordia` in `_quarto.yml`.
3. Fill in `_quarto-concordia.yml` with the author: degree level (`doctoral` or
`masters`), title, department, degree, date, committee, abstract, optional
pages. Ask them for each value; don't invent names or dates.
4. `pixi run word`, then `pixi run pdf`. Check the page numbers with them:
title and signature pages unnumbered, abstract iii, first chapter 1.

## Known limits, to say plainly

- The template gives the Word file its styles, margins, headers and page
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,31 @@ own), then run `pixi run word` again.
Or ask an AI assistant (Claude Code, Codex) to do it: `AGENTS.md` tells it the
rules, starting with *never change your wording*.

## A Concordia University thesis

The Concordia profile makes the thesis the way the School of Graduate
Studies' templates do, doctoral or master's: the title page and signature
page (counted i and ii, not numbered), the abstract and other front pages in
roman numerals from iii, a table of contents and lists of figures and tables,
and the chapters from 1.

1. `pixi run concordia`, once. It downloads Concordia's official template from
concordia.ca and builds the styles from it on your computer.
2. In `_quarto.yml`, uncomment `profile:` and `default: concordia`.
3. In `_quarto-concordia.yml`, fill in your degree (`doctoral` or `masters`),
title, department, committee, abstract and the optional pages.
4. `pixi run word`, then `pixi run pdf` for the PDF/A you submit.

Check the result against the [Thesis Preparation Guide](https://www.concordia.ca/content/dam/sgs/docs/handbooks/thesispreparationguide.pdf):
this starter follows Concordia's templates but isn't made or checked by
Concordia.

## The PDF you submit

`pixi run pdf` turns the Word file into PDF/A, the archival PDF most
universities ask for, with the table of contents and lists filled in. It
needs [LibreOffice](https://www.libreoffice.org) (free), installed once.

## فارسی

پایان‌نامه‌تان در Word است و دانشگاه یک الگوی Word داده. این پوشه فصل‌ها را به
Expand Down
36 changes: 36 additions & 0 deletions _quarto-concordia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Concordia University thesis: the School of Graduate Studies' formatting
# (title and signature pages, roman front pages from iii, chapters from 1).
# Switch it on in _quarto.yml (profile: default: concordia). Fill in yours.
format:
docx:
reference-doc: universities/concordia/reference.docx
toc: false # the front pages carry Concordia's own table of contents

filters:
- universities/concordia/front-pages.lua

concordia:
degree-level: doctoral # or: masters
title: "Archives and Their Silences"
author: "A. Researcher"
department: "History"
degree: "Doctor of Philosophy (History)" # master's: e.g. "Master of Arts (History)"
degree-short: "Ph.D." # doctoral abstract line only
date: "April 2027" # month and year of initial submission
year: "2027"
committee:
- { role: "Chair", name: "Dr. Chair Name" }
- { role: "External Examiner", name: "Dr. External Examiner" }
- { role: "Examiner", name: "Dr. Examiner One" }
- { role: "Examiner", name: "Dr. Examiner Two" }
- { role: "Thesis Supervisor", name: "Dr. Supervisor Name" }
program-director: "Dr. Program Director, Graduate Program Director"
dean: "Dr. Dean Name"
faculty: "Faculty of Arts and Science"
abstract: |
Colonial archives were not neutral collections. This thesis reads two of
them along and against their grain, and asks what their silences can tell.
acknowledgments: |
To my supervisor, and to the archivists who found the boxes.
list-of-figures: true
list-of-tables: true
5 changes: 5 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
project:
type: book

# A Concordia University thesis: run `pixi run concordia` once, uncomment the
# two lines below, and fill in _quarto-concordia.yml.
# profile:
# default: concordia

book:
title: "Archives and Their Silences"
author: "A. Researcher"
Expand Down
Loading
Loading