Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
686f767
special preview targets
StevenClontz Jul 23, 2025
84ede75
whitespace tweaks to trigger action
StevenClontz Jul 23, 2025
b9e8030
output debug logs in quickbuild
StevenClontz Jul 23, 2025
ca8a00b
fix deploy dirs
StevenClontz Jul 23, 2025
fc26b6c
update bank titles
StevenClontz Jul 24, 2025
d7b119b
update dates
StevenClontz Jul 24, 2025
4f40d61
fix name of prepare_edition
StevenClontz Jul 24, 2025
af35fc9
clean up versions and components
StevenClontz Jul 24, 2025
88ca5fe
update exercise links with version support
StevenClontz Jul 24, 2025
fa8252a
fix preview subtitles
StevenClontz Jul 24, 2025
c9a0216
if many xml IDs, just build the whole dang thing
StevenClontz Jul 24, 2025
1395d23
update library links on site
StevenClontz Jul 24, 2025
7fd8e76
update build scripts
StevenClontz Jul 25, 2025
23986dc
add comma to license
StevenClontz Jul 25, 2025
f5f057d
more script tweaks
StevenClontz Jul 25, 2025
6f7cec2
fix subtitles
StevenClontz Jul 25, 2025
ba3471e
fix precal print issue
StevenClontz Jul 25, 2025
b85f3d2
fix lots, not all, but all breaking statement/answer structures
StevenClontz Jul 25, 2025
2e67f74
fix use of arg parse
StevenClontz Jul 25, 2025
c0fb7ef
fix MX3 title
StevenClontz Jul 25, 2025
0bd010a
add deployment hint
StevenClontz Jul 25, 2025
5c95333
Fixes from @cg2wilson's review
StevenClontz Jul 31, 2025
13bcc65
build script doc tweak
StevenClontz Jul 31, 2025
6564928
add PDF viewer extension
StevenClontz Jul 31, 2025
1189d87
add explicit asset generation to edition script
StevenClontz Jul 31, 2025
76054f6
Fix error in precalc instructor
siwelwerd Aug 1, 2025
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
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"oscarlevin.pretext-tools",
"CodeChat.codechat",
"streetsidesoftware.code-spell-checker",
"lov3.sagemath-enhanced"
"lov3.sagemath-enhanced",
"mathematic.vscode-pdf"
]
}
}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pretext-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ jobs:

- name: Build precalculus activities
run: |
pretext -v debug build -g precalculus-web-instructor
pretext -v debug build -g precalculus-preview

- name: Build calculus activities
run: |
pretext -v debug build -g calculus-web-instructor
pretext -v debug build -g calculus-preview

- name: Build linear algebra activities
run: |
pretext -v debug build -g linear-algebra-web-instructor
pretext -v debug build -g linear-algebra-preview

- name: Stage builds and updated cache
run: |
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright and Licensing

All contents of this repository are copyright 2017-2024 Steven Clontz and Drew Lewis.
All contents of this repository are copyright 2017-2025 Steven Clontz and Drew Lewis,
and are licensed for free public use under the following licenses.
Contributions are warmly welcomed and encouraged; see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ accidentally committing to the main branch:
```
git config core.hooksPath .githooks
```

## Deployment

```
aws configure
aws s3 cp [path/to/year] s3://BUCKET_NAME/[year]/ --recursive
```
4 changes: 2 additions & 2 deletions codechat_config_calculus.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source_path: source
output_path: output/calculus-web-instructor
args: "{sys_executable} -m pretext build calculus-web-instructor --xmlid {xml_id} --no-knowls -g"
output_path: output/calculus-preview
args: "{sys_executable} -m pretext -v debug build calculus-preview --xmlid {xml_id} --no-knowls -g"
project_type: PreTeXt
4 changes: 2 additions & 2 deletions codechat_config_linear_algebra.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source_path: source
output_path: output/linear-algebra-web-instructor
args: "{sys_executable} -m pretext build linear-algebra-web-instructor --xmlid {xml_id} --no-knowls -g"
output_path: output/linear-algebra-preview
args: "{sys_executable} -m pretext -v debug build linear-algebra-preview --xmlid {xml_id} --no-knowls -g"
project_type: PreTeXt
4 changes: 2 additions & 2 deletions codechat_config_precalculus.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source_path: source
output_path: output/precalculus-web-instructor
args: "{sys_executable} -m pretext build precalculus-web-instructor --xmlid {xml_id} --no-knowls -g"
output_path: output/precalculus-preview
args: "{sys_executable} -m pretext -v debug build precalculus-preview --xmlid {xml_id} --no-knowls -g"
project_type: PreTeXt
42 changes: 36 additions & 6 deletions project.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@
<!-- This file, the project manifest, provides the overall configuration for your PreTeXt project. To edit the content of your document, open `source/main.ptx`. See https://pretextbook.org/doc/guide/html/processing-CLI.html#cli-project-manifest. -->
<project ptx-version="2">
<targets>

<!-- Preview targets -->
<target
name="precalculus-preview"
format="html"
publication="preview.ptx"
source="precalculus/source/main.ptx"
deploy-dir="preview/precalculus" >
<stringparams debug.project.number="the-way-it-should-be"/>
</target>
<target
name="calculus-preview"
format="html"
publication="preview.ptx"
source="calculus/source/main.ptx"
deploy-dir="preview/calculus" >
<stringparams debug.project.number="the-way-it-should-be"/>
</target>
<target
name="linear-algebra-preview"
format="html"
publication="preview.ptx"
source="linear-algebra/source/main.ptx"
deploy-dir="preview/linear-algebra" >
<stringparams debug.project.number="the-way-it-should-be"/>
</target>

<!-- Precalculus targets -->
<target
name="precalculus-web"
format="html"
Expand All @@ -19,8 +47,7 @@
name="precalculus-web-instructor"
format="html"
source="precalculus/source/main.ptx"
publication="instructor.ptx"
deploy-dir="preview/precalculus" >
publication="instructor.ptx" >
<stringparams debug.project.number="the-way-it-should-be"/>
</target>
<target
Expand All @@ -39,6 +66,8 @@
output-filename="TBIL-Precalculus-Slides.pdf" >
<stringparams debug.project.number="the-way-it-should-be"/>
</target>

<!-- Calculus targets -->
<target
name="calculus-web"
format="html"
Expand All @@ -56,8 +85,7 @@
name="calculus-web-instructor"
format="html"
source="calculus/source/main.ptx"
publication="instructor.ptx"
deploy-dir="preview/calculus" >
publication="instructor.ptx" >
<stringparams debug.project.number="the-way-it-should-be"/>
</target>
<target
Expand All @@ -76,6 +104,8 @@
output-filename="TBIL-Calculus-Slides.pdf" >
<stringparams debug.project.number="the-way-it-should-be"/>
</target>

<!-- Linear algebra targets -->
<target
name="linear-algebra-web"
format="html"
Expand All @@ -93,8 +123,7 @@
name="linear-algebra-web-instructor"
format="html"
source="linear-algebra/source/main.ptx"
publication="instructor.ptx"
deploy-dir="preview/linear-algebra" >
publication="instructor.ptx" >
<stringparams debug.project.number="the-way-it-should-be"/>
</target>
<target
Expand All @@ -113,5 +142,6 @@
output-filename="TBIL-Linear-Algebra-Slides.pdf" >
<stringparams debug.project.number="the-way-it-should-be"/>
</target>

</targets>
</project>
2 changes: 1 addition & 1 deletion publication/instructor.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<!-- See
https://pretextbook.org/doc/guide/html/publication-file-source.html#publication-file-source-version -->
<!-- <version include="videos labs"/> -->
<version include="instructor"/>
<version include="instructor nonpreview instructor-nonpreview"/>
</source>

<numbering>
Expand Down
8 changes: 4 additions & 4 deletions publication/preview.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<publication>
<common>
<!-- Level at which are html files generated (chapter/section/etc): -->
<chunking level="3" />
<chunking level="2" />
<!-- Depth for table of contents. 0 means no TOC -->
<tableofcontents level="3" />
<tableofcontents level="2" />
<!-- Visibility of exercise components where they first appear. -->
<!-- There are four components (statement/hint/answer/solution) for each -->
<!-- of five exercise types (inline/divisional/worksheet/reading/ -->
Expand All @@ -30,12 +30,12 @@
<!-- stored or created. Directories are relative to the main -->
<!-- source PreTeXt file -->
<source>
<directories external="../assets" generated="../generated-assets" />
<directories external="../../../assets" generated="../generated-assets" />
<!-- Set which marked elements are included in this version: -->
<!-- See
https://pretextbook.org/doc/guide/html/publication-file-source.html#publication-file-source-version -->
<!-- <version include="videos labs"/> -->
<version include="instructor"/>
<version include="instructor preview"/>
</source>

<numbering>
Expand Down
2 changes: 1 addition & 1 deletion publication/publication.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<!-- See
https://pretextbook.org/doc/guide/html/publication-file-source.html#publication-file-source-version -->
<!-- <version include="videos labs"/> -->
<version include="main"/>
<version include="main nonpreview"/>
</source>

<numbering>
Expand Down
12 changes: 4 additions & 8 deletions scripts/build_bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
from checkit.bank import Bank
from checkit import static

def main(book:str, full:bool, sandbox=False, stage=True):
def main(book:str, full:bool, stage_directory=None):

if sandbox:
base_path = Path("edition-sandbox")
else:
base_path = Path(".")
bank_path = base_path / "source" / book / "exercises"
bank_path = Path() / "source" / book / "exercises"

print(f"Building exercises from `{bank_path}`")

Expand All @@ -23,8 +19,8 @@ def main(book:str, full:bool, sandbox=False, stage=True):

b.build_viewer(with_cache=True)

if stage:
stage_path = base_path / "output" / "stage" / "preview" / book / "exercises"
if stage_directory is not None:
stage_path = Path() / "output" / "stage" / stage_directory / book / "exercises"
print(f"Staging bank at `{stage_path}`")
# stage bank
shutil.copytree(
Expand Down
75 changes: 75 additions & 0 deletions scripts/prepare_edition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import argparse
import glob
from pathlib import Path
import shutil
import subprocess
from pretext.project import Project
from pretext import logger
from . import build_bank
import logging

log = logging.getLogger("ptxlogger")
logger.add_log_stream_handler()
log.setLevel(logging.DEBUG)

def build_books(stage_directory=None, books=None):
if books is None:
books = ["calculus", "linear-algebra", "precalculus"]
p = Project.parse()
for book in books:
p.get_target(f"{book}-web").generate_assets(all_formats=True)
p.get_target(f"{book}-web-instructor").generate_assets(all_formats=True)
p.get_target(f"{book}-print").generate_assets(all_formats=True)
p.get_target(f"{book}-print-instructor").generate_assets(all_formats=True)
p.get_target(f"{book}-print-slides").generate_assets(all_formats=True)
p.get_target(f"{book}-web").build(clean=True,generate=False)
p.get_target(f"{book}-web-instructor").build(clean=True,generate=False)
p.get_target(f"{book}-print").build(clean=True,generate=False)
p.get_target(f"{book}-print-instructor").build(clean=True,generate=False)
p.get_target(f"{book}-print-slides").build(clean=True,generate=False)
if stage_directory is not None:
stage_path = Path() / "output" / "stage" / stage_directory / book
print(f"Staging book at `{stage_path}`")
# stage book
shutil.copytree(
Path("output") / f"{book}-web",
stage_path,
dirs_exist_ok=True
)
shutil.copytree(
Path("output") / f"{book}-web-instructor",
stage_path / "instructor",
dirs_exist_ok=True
)
shutil.copytree(
Path("output") / f"{book}-print",
stage_path / "print",
dirs_exist_ok=True
)
shutil.copytree(
Path("output") / f"{book}-print-slides",
stage_path / "print",
dirs_exist_ok=True
)
shutil.copytree(
Path("output") / f"{book}-print-instructor",
stage_path / "print",
dirs_exist_ok=True
)

def build_banks(stage_directory=None, books=None):
if books is None:
books = ["calculus", "linear-algebra", "precalculus"]
# build and stage banks
for book in books:
build_bank.main(book=book, full=True, stage_directory=stage_directory)

def main(stage_directory=None):
build_books(stage_directory=stage_directory)
build_banks(stage_directory=stage_directory)

if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Build final editions of books.')
parser.add_argument('stage_directory')
args = parser.parse_args()
main(stage_directory=args.stage_directory)
Loading