chharvey / chharvey.github.io

My personal web site.
https://chharvey.github.io/
MIT License
4 stars 1 forks source link

codeblock syntax highlighting #42

Closed chharvey closed 9 years ago

chharvey commented 9 years ago

allow syntax highlighting for any block of code (not just .Codeblock.HTML or .Codeblock.CSS).

If in a code.Codeblock, do not automate punctuation. if styles were removed, the content would lose its meaning.

If in a block with semantic elements, e.g. code.CSSmap, punctuation may be automated.

chharvey commented 9 years ago

new color syntax for HTML, CSS, and JS code done.

Currently, certain components of HTML and CSS have automated delimiters. While this is efficient on the HTML side of things and saves lots of typing, it is not semantically correct when there are mere span Elements involved. The semantics of (normal) code is determined by delimiters, punctuation, spacing, etc. If this is automated with CSS (via the ::before and ::after pseudo-elements), then the semantics are lost, on the server, and especially if styles are turned off.

To remedy this, one might remove the psuedo-element selectors and manually add back in all the delimiting characters (<, >, ", ', {, }, (, ), etc.) in the HTML. However this is very tedious and time-consuming.

Leaving automation of delimiters in CSS for now, will transfer automation to server-side JS or templates (#9) at a future time. Of course, automation of delimiters in .CSSmap will remain in CSS due to the already-present semantics in the HTML Elements (dt, dd, etc.)