-
Notifications
You must be signed in to change notification settings - Fork 1
PDF formatter soft line breaks #754
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
Conversation
2425f3c to
40eb448
Compare
* Sort scripts and fix double code generate
* Add support for parser tracing in test environment
Trace parsing like below:
```
const song = trace(chordSheet, (tracer) => (
parser.parse(chordSheet, { softLineBreaks: true, tracer })
));
```
* Fix parsing soft line break following a bracket
Related to bettermusic#754
* Disable Jest's console to remove verbose logging
* `debug:chordpro` debug task using peggyjs editor
Running `yarn debug:chordpro` will open up `peggyjs.org/online.html` with the full chordpro grammar and JS compilation of the helpers included.
f2c931a to
124ea43
Compare
|
@martijnversluis What about giving "SoftLineBreak()" a content value in the model so that the soft line break is either got nothing (when it's a backslash) or it has content that could be a comma ',' then the renderer's can decide to render the content of the SoftLineBreak when it encounters it. thoughts? |
bb86a85 to
d255fd6
Compare
I considered it, but got it working without it. That would've meant we had to render soft line breaks. Instead, we now replace a comma with a soft line break and a ChordLyricsPair with the comma (and optional space) as lyrics. |
With this approach, would the comma always render? When the softline break logic actually breaks to the next line it should capitalize the first letter, which makes the comma not needed gramatically. This might be difficult to achieve. |
|
I think all the issues with PDF formatting have been fixed in this PR. However, there is currently a weird build error both in this branch and on master and PR branches. In most cases there is an error |
|
So there's still a number of issues that either weren't issues before or got introduced with other adjustments. I decided to take a stab at the the pdf formatted myself (along with some help) and really drilled into the example "kingdom" chart comparing what the current PC renderer does, I think I made some pretty good progress, but some approaches are drastically different. I wanted to try a few things differently. https://github.com/bettermusic/ChordSheetJS/tree/pdf-formatter-slb-isaiah All tests pass except for the pdf one because I couldn't figure out how you determined the exptectedText & expectedLines. Here's a list of some of the things I saw and addressed:
PC chart:
this branch:
Moving Forwardoutstanding issues even in my own branch that would still be there before being able to replace all of the PraiseCharts PDF generating to run through this library would be:
And that would just get us to a product that I could roll out to everyone to replace what we have. But then I'd still have features (weren't in this PR's scope) of improvement we'd plan to add to make them even better.
Would love to sync up over a call if you have time. |
6b591e9 to
d69228e
Compare
* Ensure correct types and formatting * Implement soft line breaks in PDF formatter * Add process module * fix: set column to 1 every render, allow comments to render * Fix spacing for words and paragraphs * Add missing trailing newline * Treat commas as soft line breaks * Fix line spacing for a line after soft line break * Capitalize first letter after soft line break * Add basic testing for PdfFormatter * Fix toBeKey signature * feat(wip: try different approach for pdf formatting * fix: type suggestions and add fix missed merge conflict * feat: add custom font to fix rendering issue * fix: adjust how soft line breaks render * Improve matchers and fix test --------- Co-authored-by: Martijn Versluis <[email protected]>
…chord lyric pair has empty lyrics.
add line breaking to layout text item refine test pdf to match PC chart
5cbd478 to
d9edf60
Compare
- enhance dev:pdf experience - add italics font - support soc sov section labels as well as comments - fix comma placement in soft line breaks
|
No I'm still getting I can see it got further in the CI though... Something with my node version and what's in the yarn.lock is causing grief. I happen to be running 18.19.1, but then I also encounter the exact same error when running 20.18.0... Can you try cleaning node_modules and pushing a new yarn.lock file and tell me what version of node you're running? It's gotta be somehow related to that. I'll keep messing with it, clearly is something related to my machine/env, since CI isn't encountering it across all those versions. |
|
🎉 |
|
🤦♂️ Wasn't actually using the Adjusted so it does that, and also updated the |
|
Nice! I think we should merge this beast and start new PRs for follow-ups 👍 |
|
Boom! 💥 |













No description provided.