This pull request makes quite a lot of __internal_ things on DomBuilder, StylesheetBuilder, ClassBuilder visible from outside.
Why do I want this?
Currently, the only way to use these methods are from utility macros, despite them being perfectly fine usable by themselves.
For example, instead of just doing ClassBuilder::new().style("foo", "bar").finish(), I am forced to call the macro.
Similarly, the with_node! macro only works within a html! context, and not a DomBuilder::new_html("foo")....into_dom()
Without the methods being public, its hard to make custom macros, as I have to directly inspect the source code.
As the macros to access the methods are currently undocumented, it is difficult to see which macro should be used. For example, from looking at the ClassBuilder documentation it is unclear how to generate one; this could also be solved by documenting the macros, but that might better be served by exposing the methods and saying "You can also use with_node!".
This pull request also adds a finish() method to DomBuilder, in order to make its api more similar to StylesheetBuilder and ClassBuilder, which both are given finish() methods.
This pull request makes quite a lot of
__internal_
things onDomBuilder
,StylesheetBuilder
,ClassBuilder
visible from outside.Why do I want this?
ClassBuilder::new().style("foo", "bar").finish()
, I am forced to call the macro. Similarly, thewith_node!
macro only works within ahtml!
context, and not aDomBuilder::new_html("foo")....into_dom()
ClassBuilder
documentation it is unclear how to generate one; this could also be solved by documenting the macros, but that might better be served by exposing the methods and saying "You can also usewith_node!
".This pull request also adds a
finish()
method toDomBuilder
, in order to make its api more similar toStylesheetBuilder
andClassBuilder
, which both are givenfinish()
methods.