This will become the repository for the home page for PreTeXt, to be hosted at pretextbook.org.
The files to build the PreTeXt website live in the site directory. We hold on to a copy of old_site to help with the transition; eventually this will go away.
Inside site, the pages directory contains the markdown files that make up the content of the site, while the theme directory contains the templates and static resources (css, js, images, etc) used to style the site. The site.json file contains the build configuration for Pelican to generate the static html pages.
In scripts we include a build.sh bash script that can automate a local build of the Guide and all the various examples. These should be placed in subdirectories of the local output folder.
Then to generate the front pages, run pretext deploy --stage-only. This will create the static html pages in output/stage, copying the contents of each project inside output. (The location of these, and their destinations inside the stage directory is determined by the project.ptx file).
Finally, the contents of output/stage can be either deployed to a github pages or copied to another web server.
It would be simple to use the fetch_sources.py script to download the most recent versions of the PreTeXt-generated parts of this site into a non-tracked source directory. Then the PreTeXt CLI could build each of these (using pretext build --deploys) into the appropriate subdirectory of output.
If we transition to this workflow, the following description would apply (but for now, we stick with the old way of building).
The PreTeXt-CLI allows for multiple targets to be built and to create a custom landing page using Pelican to generate the static landing pages. The static landing pages live in the
sitedirectory, which containsthemeandpagesdirectories, as well as asite.ptxfile that specifies the build configurations for Pelican. Pelican will transform the.mdfiles inpages, using the templates inthemeand place the resulting static html inoutput/stageas part of thepretext deploycommand.
The
pretext deploycommand will also copy the output from each target listed inproject.ptxto its specifieddeploy-dirinsideoutput-stage. Then this is all copied to thegh-pagesbranch which is pushed to github.
In addition to the static pages describing PreTeXt, the website contains many HTML and PDF documents generated by PreTeXt. These are created in two different ways.
- The CLI builds them as targets listed in
project.ptx. Before this is done, the most recent versions of these documents are downloaded from their respective repositories and placed in appropriate folders insidesource, using thescripts/fetch_sources.pypython script.pretext/pretextbuilds them as specified inscripts/build.sh, placing them inside an appropriate static resources folder insidesite. (TODO)
All of the above process could be automated using github actions.
TODO:
- If we want to use the CLI to use the most recent commits from PreTeXt, we could easily clone the pretext repository and CLI repository and initialize the dev environment with poetry to complete the build. This can be part of a github action. (Perhaps this is done by default but can be overriden if there are errors?)