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

Fix railroad so head, body args included in html #479

Merged
merged 1 commit into from Apr 18, 2023

Conversation

schnorea
Copy link
Contributor

Minor fix in the railroad diagram code. Output wasn't getting the railroad.css styling. Attempts to include using this

style = """ # css styling """
...
# PEG definitions
statement = ....
....
statement.create_diagram("railroad_diagram_demo.html", vertical=6, show_results_names=True, embed=True, head=style)

failed. railroad_diagram_demo.html had no styling added except for what was in the template.

Noticed that **kwargs weren't being passed through to the template.

Added **kwargs in for the fix.

@ptmcg
Copy link
Member

ptmcg commented Apr 18, 2023

Thanks for this. Could you send me a tiny example that I could use to create a test for this? (I'm not too expert in CSS.)

No need for another commit, just post a comment here. For the grammar, just use something simple like Word(alphas)[...].set_name("words") Not really interested in the diagram, just in verifying the use of **kwargs.

@ptmcg ptmcg merged commit d0d6a81 into pyparsing:master Apr 18, 2023
13 checks passed
ptmcg added a commit that referenced this pull request Apr 19, 2023
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.

None yet

2 participants