delphidabbler / codesnip

A code bank designed with Pascal in mind
https://delphidabbler.com/software/codesnip
Other
110 stars 33 forks source link

Permit annotated source and units to be rendered in HTML5 #87

Open delphidabbler opened 1 year ago

delphidabbler commented 1 year ago

There's already the option to render annotated source code and units in XHTML. It would be useful to update this to HTML5.

delphidabbler commented 1 year ago

Could either update or (more likely) provide as an additional option.

delphidabbler commented 1 year ago

May need to change THTML advanced record in UHTMLUtils into an abstract static class and derive two new classes from it: TXHTMLTag and THTML5Tag.

These classes would differ only in how they render simple tags.

It would be better to rename THTML as THTMLTag, regardless of whether it is changed into a class, because that better describes what it does. Additionally, changing the name would aid in changing all current references to THTML to TXHTMLTag.

delphidabbler commented 1 month ago

Although it would go against good OOP design, given the change would only be to the rendering of simple tags, maybe it would be much simpler to pass a parameter to the relevant method(s) to specify either XHTML or HTML5.

Rather than a Boolean typed parameter such as IsHTML5, an enumerated type parameter would document intention better, such as:

type
  THTMLVersion = (
    XHTML,
    HTML5
  );