Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding prefigure to the pretext codespace #20

Open
davidaustinm opened this issue Nov 21, 2024 · 2 comments
Open

adding prefigure to the pretext codespace #20

davidaustinm opened this issue Nov 21, 2024 · 2 comments

Comments

@davidaustinm
Copy link

I have PreFigure running in a codespace and just wanted to outline the steps that would be necessary to add PreFigure into the PreTeXt codespace.

  1. There are some additional packages to be installed in the docker container: python3-louis, npm, nodejs, libcairo2-dev, pkg-config, librsvg2-bin
  2. Include pip install prefig[pycairo] in the docker container
  3. In the postCreateCommand, include echo '/usr/lib/python3/dist-packages' > /usr/local/lib/python3.12/site-packages/louis.pth since python3-louis installs the python module louis in a location that is not in the pythonpath.
  4. Also in the postCreateCommand, include prefig init which installs the MathJax libraries and the Braille29 font.

For reference, the prefigure-codespace repository (linked above) contains the Dockerfile used to build the container published on dockerhub and the script postCreateCommand.sh

@oscarlevin
Copy link
Member

I have tried to put all this into the docker image for pretext. Is there a reason that your postCreateCommand shouldn't just be part of the docker image?

If you want to try out a new codespace in 15 minutes or so, the docker images should be updated by then.

@davidaustinm
Copy link
Author

Thanks for making this change. Everything is working well except that the Braille29 font isn't being installed. It is copied into the right place (/root/.fonts), but then fc-cache doesn't seem to install it system wide, even with the directory explicitly given and the flag "--really-force" set. If I copy the font into /usr/share/fonts and try fc-cache, then it is installed. I'm not sure why this would be different in the two codespaces.

The permissions are also different in that the pretext codespace needs sudo to copy the font into /usr/share/fonts, but my codespace doesn't.

I included some of those commands in the postCreateCommand because I wanted them to happen in the directory /workspaces/prefigure-codespace. Also, I experimented a bit to get the path to louis set up and didn't want to rebuild the container all the time. That command could certainly be moved into the container as you've done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants