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 support for seeing original, markup, and edited versions for HTML and PDF #5

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gbruer15
Copy link
Contributor

This PR adds a meta variable critic-markup-version that can specify the output format. It can be "all", "markup", "edited", or "original". It's default value of "all" does the normal thing of showing all three formats.

This format option is especially useful for looking at the edited or original form of the PDF, which previously, only supported the "markup" output.

Unfortunately, outputting multiple versions with the same file extension is difficult with Quarto.

  • For HTML, the output file for each format needs to be defined to avoid overwriting the other formats' output.
  • For PDF, defining the output file does not affect the intermediate latex file that is created. Instead, the pandoc modifier (adding "+something" after the Quarto format name) must be used, but the output file doesn't need to be defined. (This doesn't work for HTML).

Since the pandoc modifier has to be used for PDF, I simplified the syntax to allow the critic-markup-version variable to be read from the output file name. So if the modifier is a valid critic-markup-version value, it is read as the default instead of using "all" as the default.

Here's is an example of what the pdf format looks like for each version:

This PR also essentially disables the filter for Quarto output formats other than HTML, PDF, and Latex, thereby fixing a bug that caused the filter to break other Quarto output formats.

@mloubout I'd like to get your opinion on these changes before I update the documentation and mark this PR as ready.

@mloubout
Copy link
Owner

So this is something I was hoping to get to when I find time (see here for people interest as well) so thank you so much for doing the heavy lifting.

My only question is, is it really worth the trouble to output multiple documents. I would think that in practice, people would work with the "tab view" HTML output then once done, just outputs the edited version to publication format. But that's really nitpicking

@gbruer15
Copy link
Contributor Author

My only question is, is it really worth the trouble to output multiple documents. I would think that in practice, people would work with the "tab view" HTML output then once done, just outputs the edited version to publication format. But that's really nitpicking

My use case for this is for a collaboration where some people like working with Quarto and some people prefer to keep an eye on the changes with PDF and give verbal feedback. I agree most people wouldn't care about outputting the multiple versions.

@mloubout
Copy link
Owner

Ok sounds good. Happy with this and happy to merge and burn new version

@gbruer15
Copy link
Contributor Author

I won't be able to add the documentation for a week or so. Feel free to merge it now if you want, or I think you can steal the branch and add documentation.

Also, right now the watermark on the PDF is always shown, but probably it should only be shown for the "all" output. So that's a future work.

@gbruer15 gbruer15 marked this pull request as ready for review July 30, 2024 14:35
@gbruer15
Copy link
Contributor Author

@mloubout I updated the README with some information from this PR. I'm fine with it being merged anytime. Let me know if there's something you'd like me to change before merging.

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.

2 participants