Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spinneret-tags(:nsection): Make smarter when nested/local.
This binds the spinneret::*html-path* (the variable representing the nesting of the HTML tags so far) to a value matching the required level of headings, thus making all the :h*/:nsection inside :nsection to be consistent with the level of the :nsection. In other words, (spinneret:with-html-string (:nsection :title "hello" :level 4 (:nsection :title "what"))) returns <section id=hello> <details open> <summary> <h4 style=\"display: inline\">hello <a href=#hello>#</a></h4> </summary> <section id=what> <details open> <summary> <h5 style=\"display: inline\">what <a href=#what>#</a></h5> </summary> </details> </section> </details> </section> instead of the previous version, where the inner heading was <h2>.
- Loading branch information
e81027e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: abstracting setting
*html-path*
toin a function would make it more readable. Then you could expand on what it does in its docstring (in other words, moving the commit explanation to the function's docstring).
e81027e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've chosen to add an explanation commentary, because I'm too lazy to reason about function/macro interactions at the moment: 3ae2229.