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

Integrate wca-edudoc style into compiler toolchain #120

Closed
wants to merge 5 commits into from

Conversation

gregorbg
Copy link
Member

Porting of the format used for https://github.com/suushiemaniac/wca-edudoc into the official documents repo.

Basically introduces a second loop that uses a different CSS stylesheet for wkhtml as well as custom headers and footers. The principle architecture has been discussed with and approved by @viroulep.

In particular, this PR will slightly change the structure of the build/ folder: Instead of directly replicating the contents inside the documents/ folder it instead copies the folder as a whole so that we will now have:

build/
-- documents/
---- Code of Ethics.pdf
---- etc.
-- edudoc/

This change is for the website to be able to differentiate which documents to link on which page (in an upcoming PR)

I have also included the current working state of the competitor tutorial at my wca-edudoc repo as a sanity check.

@gregorbg gregorbg requested a review from viroulep November 10, 2019 18:33
@gregorbg gregorbg requested a review from a team as a code owner November 10, 2019 18:33
find 'documents' -name '*.md' | while read file; do
echo "Processing $file, vanilla style"
Copy link
Member Author

Choose a reason for hiding this comment

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

Do we want log messages? I found them extremely helpful during development, and with multiple folder structures I think they would be beneficial during deployment as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

I definitely don't mind having that, the travis log is pretty short anyway.


# Find educational Markdown files and build PDFs out of them.
find 'edudoc' -name '*.md' | while read file; do
echo "Processing $file, edudoc style"
Copy link
Member Author

Choose a reason for hiding this comment

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

For log output, please see my other comment at L7: https://github.com/thewca/wca-documents/pull/120/files#r344507366

Copy link
Contributor

@viroulep viroulep left a comment

Choose a reason for hiding this comment

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

Overall the code looks pretty good to me, I'll test that locally to see if the build branch ends up in the state we discuss, and I'll work on the website-related pr before formally approving that!

cp -r documents build
find build -name '*.md' -exec rm {} +
find documents -name '*.pdf' -exec rm {} +
# Create build dir so that the following cp operations maintain folder structure
Copy link
Contributor

Choose a reason for hiding this comment

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

For anyone else reading this: this requires some slight changes on the WCA website side of things, on which I'll work.

@gregorbg
Copy link
Member Author

gregorbg commented Dec 7, 2019

I have added a fix for embedding images, because the path resolution used by wkhtmltopdf is not that intuitive. c/p from my code comment:

# deliberately NOT using the pipe | operator here because wkhtml tries to resolve image links
# based on the location of its input file. If piping is used, wkhtml assumes /tmp as location
# and links like "./dummy-image.png" become "/tmp/dummy-image.png" instead of "edudoc/$project/dummy-image.png"

This means we now produce an intermediate html file during build, which is then removed later on during that same build process.

@cubewhiz
Copy link
Member

cubewhiz commented Jan 2, 2020

Let us know when this is ready to be merged so that the Board can provide the approving review.

@viroulep
Copy link
Contributor

I just pushed @leonopulos updates, it's not finished though.

@viroulep
Copy link
Contributor

Superseded by #154.

@viroulep viroulep closed this Apr 25, 2020
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

Successfully merging this pull request may close these issues.

4 participants