|
Call me old-fashioned, but when I look at the source code of a web page designed using the "modern" frameworks, it looks like a horrible mess of JS/CSS with very little actual content. E.g. take a look at this guy's code snippet's HTML source in the middle of the page - it's just a wall of <div>s and <span>s, for every single visible character. The search engines these days cannot even function without a JS interpreter, something that surely increases the complexity and cost of building one. Long gone are the days when one cared about semantic elegance of HTML code, per-site optimized CSS stored in an external file for easy caching, only occassional use of JS for easier navigation... Nowadays you don't build websites, you have to build "apps". It's one of many signs of the "appification" of Internet. |
That said, how would you propose to do syntax highlighting instead of
> just a wall of <div>s and <span>s, for every single visible character
? Rather than being a wall, it looks to me like it's actually a tree of <divs> and <span>s for every line and every _token_.
I think the author has used Prism[1], so I assume the highlighting was done client-side, but even if you were to do the task server-side I think you'd end up with similar HTML/CSS, no?
What would be a better approach to solving the same problem?
[1]: https://prismjs.com/