Repository navigation
Pin pydyf<0.11 to fix PDF export with WeasyPrint + Support multiple author emails and render them as mailto links - #531
Open
alireza5969 wants to merge 2 commits into
Open
alireza5969 wants to merge 2 commits into
alireza5969 wants to merge 2 commits into
Conversation
|
AppVeyor build 1.0.350 for commit b5684ef is now complete. Found 51 potential spelling error(s). Preview:content/02.delete-me.md:44:adipiscingcontent/02.delete-me.md:44:aliqua content/02.delete-me.md:44:amet content/02.delete-me.md:44:consectetur content/02.delete-me.md:44:dolore content/02.delete-me.md:44:eiusmod content/02.delete-me.md:44:elit content/02.delete-me.md:44:incididunt content/02.delete-me.md:44:ipsum content/02.delete-me.md:44:labore content/02.delete-me.md:44:Lorem content/02.delete-me.md:44:magna content/02... |
`manubot` printed out `X Y <['x@y.com', 'x.y@gmail.com']>. ` with no hyperlinks. I changed it so it can print out the correspondings' emails neatly.
pydyf<0.11 to fix PDF export with WeasyPrintpydyf<0.11 to fix PDF export with WeasyPrint + Support multiple author emails and render them as mailto links
|
AppVeyor build 1.0.351 Found 51 potential spelling error(s). Preview:content/02.delete-me.md:44:adipiscingcontent/02.delete-me.md:44:aliqua content/02.delete-me.md:44:amet content/02.delete-me.md:44:consectetur content/02.delete-me.md:44:dolore content/02.delete-me.md:44:eiusmod content/02.delete-me.md:44:elit content/02.delete-me.md:44:incididunt content/02.delete-me.md:44:ipsum content/02.delete-me.md:44:labore content/02.delete-me.md:44:Lorem content/02.delete-me.md:44:magna content/02... |
Member
|
If the package version needs to be locked, merging that change makes sense. I haven't tested it yet.
I don't see this as a real problem we've faced. Our users provide one email address as a string, as documented. I'm not that interested in generalizing to support multiple emails per author. |
csunijena
added a commit
to rfb-data-hub/guidelines-living-doc
that referenced
this pull request
Nov 5, 2026
…ty README (#1) * Update Manubot CI actions, pin pydyf, and personalize README - Bump GitHub Actions to current major versions: checkout v6->v7, cache v5->v6, setup-miniconda v3->v4, upload-artifact v6->v7, setup-python v6->v7 - Pin pydyf<0.11 in build/environment.yml: weasyprint 53.4 fails with pydyf >= 0.11 in the local (non-Docker) PDF build path (cf. manubot/rootstock#531) - Replace rootstock placeholder title and description in README * Import accepted Chem Rev manuscript into Manubot content - Split manuscript into numbered section files plus abstract - Convert 10 figures to PNG in content/images with fignos IDs - Convert 292 numbered references to Manubot citation keys (279 DOI-based, 13 manual references) - Move authors/keywords to metadata.yaml and align corresponding authors (Goulet, Brushett, Aziz) and Zenodo affiliations - Correct Kangro spelling (verified against DE914264C) and add the missing final period to the abstract * Use non-deprecated auto-activate input for setup-miniconda v4 * Set corresponding authors to Goulet and Stolze * Rewrite README for the living document; add Zenodo release metadata - README now describes the manuscript, the living-document intent, and a contributor tutorial instead of the rootstock boilerplate. - .zenodo.json provides complete deposit metadata for Zenodo's GitHub release integration (only official releases mint DOIs).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem 1
bash build/build.shfails at the PDF export step on a fresh environmentcreated from
build/environment.yml:HTML export works, and the CSS warnings printed before the traceback are
harmless (WeasyPrint skips properties it doesn't support).
Cause
The pinned WeasyPrint version calls
Stream.transform()frompydyf, butpydyf0.11 removed that method. Becausepydyfisn't pinned, a freshinstall resolves to a version that is incompatible with WeasyPrint.
Fix
Pin
pydyf<0.11inbuild/environment.yml:Testing
build/environment.ymlmamba install "pydyf<0.11"):bash build/build.shcompletes and produces the PDF
Notes
This pin can be removed once the project bumps WeasyPrint to a version
compatible with newer
pydyf(WeasyPrint 61+).Problem 2
The correspondence block in
content/00.front-matter.mdrendersauthor.emaildirectly:{{ author.name }} \<{{ author.email }}\>This has two problems:
emailis documented as a string, but users naturally write several addresses as a YAML list. Jinja then prints the list repr, producing output likeName <['a@x.org', 'b@y.org']>.\<and\>are escaped, so Pandoc does not autolink the address. The output is plain text such asName <a@x.org>.Change
content/00.front-matter.md: in the#correspondenceblock, normalizeauthor.emailto a list. A string becomes a one-item list, a list is used as is, and null or a missing value becomes an empty list. Each address is then rendered as an explicit[addr](mailto:addr)link.Name (a@x.org, b@y.org).USAGE.md: document thatemailmay be a string or a list.No change to Manubot itself is needed.
Why in the template and not in Manubot
Manubot normalizes
affiliationsandfundersto lists inmanubot/process/util.py. Doing the same foremailwould break existing manuscripts whose custom templates use{{ author.email }}as a string, because they would start printing list reprs. Handling both types in the template is backward compatible.Behavior
emailinmetadata.yamlTesting
Rendered the template with Manubot's Jinja2 environment (
make_logging_undefined, same delimiters and extensions) and converted the result with Pandoc to HTML. I checked string, list, single-item list, null, missing and non-corresponding authors, plus addresses containing underscores and dots. I also confirmed the correspondence block in a real manuscript build, where each address becomes a workingmailto:link.Note for reviewers
This changes the visible format from
Name <email>toName (email). I think this is better, since the angle brackets were needed only to imitate an email header. If you prefer to keep<...>, it is a two-character change in one line.