Closed dscottboggs closed 4 years ago
I've also changed the private
state of a few methods on HTMLRenderer
to protected
so I can use them in a custom HTML renderer.
I've also changed the private state of a few methods on HTMLRenderer to protected so I can use them in a custom HTML renderer.
Why did you need this? A custom renderer would inherit from HTMLRenderer
, so it can also use these private methods.
I thought "private" meant "only to this implementation" whereas "protected" was "this and all subclasses". If that's not the case then I certainly withdraw my suggestion.
Nope, that's not how it works: https://crystal-lang.org/reference/syntax_and_semantics/visibility.html
Thanks, @straight-shoota. When I was changing lf
I noticed that it might also be desirable to use literal
instead of lit
. If you disagree let me know and I'll change it back
When reading the source-code of
renderer.cr
andhtml_renderer.cr
I was confused by two things:cr
to indicate that a LF character'\n'
was being written. Understandable mistake but was confusing to read.out
was highlighted in my IDE as a keyword, but I knew I wasn't being used in a context where it would be a keyword. Being an inherited method further obscured this. Using the nameoutput
instead clarifies this.Again these are just a couple quick suggestions I thought of while figuring out how to implement a custom renderer, you can feel free to close this if you want to keep your version. I just don't like to suggest things without offering to help.