Closed vshesh closed 7 years ago
In order to implement a view component library based element, there is much work to do! Here are the implementations of this idea in increasing degrees of fidelity:
glue assets [file1] [file2]
and spits out all required assets for the blocks in the files. #8Basically, it's an amalgamation of what was previously in three different issues. They all go together though, and represent the next feature set for the glue
project.
Ok, the first example of a component that benefits from a view library is here (react, mithril). It's an annotated code element. It can be written with raw HTML/JS if you're nuts, but in this case we end up with lots of boilerplate code in the form of repeated event calls.
In this case, the "HTML" returned by the server would be:
code
andannotations
are taken from the code block. If given a code block like:And I know the comment start characters (
#
in this case), so I can fold each comment onto the next line and make it into an annotation so it renders a block of code with hoverable comments that appear below.This makes it much easier to follow along with the code example rather than looking at comments interspersed with code, especially if there's a longer discussion that can distract from the flow of the code.