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 SXML indentation on output. #867

Merged
merged 2 commits into from
Oct 11, 2022

Conversation

arthurgleckler
Copy link
Contributor

This adds a second optional argument to sxml-display-as-html. If true, it adds newlines and indentation where appropriate. This makes reading the HTML easier.

@lassik
Copy link
Contributor

lassik commented Oct 11, 2022

We should probably use keyword arguments or a settings object of some kind. It's not easy to predict what options will be added in the future.

Copy link
Owner

@ashinn ashinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two optional arguments is fine, no need to use keywords here.

(let lp ((sxml (if (and (pair? sxml) (eq? '*TOP* (car sxml)))
(cdr sxml)
sxml)))
sxml))
(i 0))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: i sounds like a normal counter, maybe better to name this depth or indent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I renamed it depth.

@ashinn ashinn merged commit 6d58f9e into ashinn:master Oct 11, 2022
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.

3 participants