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

Add pandoc for PDF creation and GitHub Actions for auto-generation #632

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rcalixte
Copy link

@rcalixte rcalixte commented Dec 26, 2021

Changes for added functionality:

  • Adding a pandoc script to generate PDFs on the CLI
  • Adding files to support auto-generation of tagged releases from master branch with PDFs as assets (tags are based on the 7 character commit hash) using GitHub Actions (currently free for public repos)
  • Localizing the remaining imgur references

Changes to support PDF output:

  • Updating the .gitignore to add PDFs
  • Removing an errant character (^H) to allow the Chinese PDF to generate successfully
  • Updating image tags in English files as they serve as image footers in the generated PDF

Minor change:

  • Fixing small typo in comment of epub shell script

Issues addressed:

Local environment with successful pandoc.sh script execution:

$ pandoc --version 
pandoc 2.14.1
Compiled with pandoc-types 1.22, texmath 0.12.3, skylighting 0.11,
citeproc 0.4.1, ipynb 0.1.0.1
User data directory: /home/rcalixte/.local/share/pandoc
Copyright (C) 2006-2021 John MacFarlane. Web:  https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.

$ tex --version
TeX 3.14159265 (TeX Live 2019/Debian)
kpathsea version 6.3.1
Copyright 2019 D.E. Knuth.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the TeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the TeX source.
Primary author of TeX: D.E. Knuth.

$ lsb_release -d
Description:    Ubuntu 20.04.3 LTS

@rcalixte
Copy link
Author

rcalixte commented Dec 26, 2021

@donnemartin I'm aware this is a rather large PR and might take some time to review. Please feel free to let me know if there's any changes that can be made. There's a workflow in the forked repository if you want to see it
in action too.

The PDF I attached in #4:
system-design-primer.pdf

tlmgr install ctex enumitem float koma-script

# Generate PDFs using pandoc
for filename in pandoc-*yaml; do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enhancement for a future PR - could consolidate the code in this file and pandoc.sh, to remove duplication. Then just pass an argument/flag to toggle docker/local calls.

Although this looks good as is.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jackson15j Thank you for the review! I'd actually started with functions for each. The challenge and the reason it was split is because the script for the Docker container uses a different shell invocation due to what is available within the container (/bin/bash vs /bin/sh). We could investigate other container options that ship with /bin/bash and the pandoc/tex tools and simplify things but it should work as is if someone were to want to clone the repo and run the pandoc script locally.

Copy link

@jackson15j jackson15j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Majority is adding descriptions to images. Would be good to get this CI in and then build off it (eg. Fix & Publish epubs #353, #531, publish gitbook format #7 ).

@rcalixte
Copy link
Author

Ditto. There are other changes I want to make that are purely content changes or corrections but I wanted to keep this already large PR strictly to what was needed for the automation components. There are additional PRs I plan to open once this is merged.

@rcalixte
Copy link
Author

@donnemartin Is there any chance you'll be able to review this soon? I'm open to feedback or next steps. 🙏🏽

@rcalixte rcalixte force-pushed the pandoc branch 24 times, most recently from f5fd221 to 0bbaa89 Compare July 29, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PDF Download
3 participants