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

Whitespace in Lowfat #22

Closed
jonathanrobie opened this issue Jun 13, 2022 · 10 comments
Closed

Whitespace in Lowfat #22

jonathanrobie opened this issue Jun 13, 2022 · 10 comments

Comments

@jonathanrobie
Copy link
Contributor

Whitespace in Lowfat has changed in ways that make it harder to read in some editors.

Could we please restore whitespace to the previous form? This is probably as simple as running the transform originally used to create it, making sure we keep all the attributes.

@ryderwishart
Copy link
Contributor

Can you describe the issue a little more specifically? Do you mean you would like every attribute on its own line, regardless of line length?

@klosoter
Copy link
Contributor

klosoter commented Jun 16, 2022

This probably happened because of me. The Python library I use (lxml) puts all attributes on the same line as the element. As far as I know, there are no easy ways (with Python) to change the formatting of an XML file. So, it will probably happen again when I make new commits.

Any ideas on how to avoid this problem?

@themikejr
Copy link
Contributor

@klosoter lxml has a pretty print option that will improve the formatting (see this gist). There are also other python libraries that may offer more customization for xml formatting (e.g. xmlformatter). Ideally though, the lowfat data pipeline for hebrew and greek would have some final formatting step that is automated and consistent across repos.

@jonathanrobie
Copy link
Contributor Author

@klosoter Up to now, Lowfat has always been generated from Nodes using an XQuery that does the right thing.

I don't think it's good to update the two in parallel, I think one should be generated from the other.

@klosoter
Copy link
Contributor

Let's generate lowfat from the other trees, then. Indenting attributes on a new line is not something pretty print or xmlformatter can do.

@ryderwishart
Copy link
Contributor

I can regenerate the lowfat trees right now on your branch. However, did we resolve the nodes that were getting dropped?

@klosoter
Copy link
Contributor

I did

@klosoter
Copy link
Contributor

Also, I made some changes in lowfat (there were duplicate xml:id) and some Node/m that should have been wg/w.

@klosoter
Copy link
Contributor

This is about macula-hebrew right? @ryderwishart

@ryderwishart
Copy link
Contributor

Yes that's right @klosoter. Didn't notice it was the wrong repo. 🤦‍♂️

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

No branches or pull requests

4 participants