feat(pv-stylemark): add suport for js and html executable code blocks support the hidden attribute #224
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
== Description ==
The original stylemark allowed different types of fenced code blocks that contained the content for the examples: Executable code blocks spec
This PR will add support for these two variations:
The embeded html code is handy if the components are mostly self rendering custom elements which don't need much html. This will allow to showcase them in different variations better integrated in the markdown (e.g. each option is described and an example added right after. without the need to create a hbs file for each example or put all examples in the same page)
Also added support for the
hidden
attribute (or rather the lack of). This is mainly to provide backwards compatibility and the use case is something like this where you want to execute some code and also show it in the readme at the same time.What is still missing is support for js and css files:
But it is a little unclear e.g. the path is relative to where? the target folder as is for the html files or the markdown file in the src where the developer is writing the content and then do they expect stylemark to copy those files to target? does it need to maintain the same folder structure or can they be copied flat to
styleguide
? how they should be loaded, in head or in body? as sync script or async or type module etc? or make these all configurable?Right now of course the new styleguide needs to be backwards compatible to make the transition easier, but i would argue for instead of the original stylemark pattern
example.html
change it tohtml example
:This is more markdown spec comform and allows the IDE's to syntax highlight the content. similarly for referenced files i would also replace the
:
notation with using a space for more consistence, easier readability for the developer and easier parsing for us. (key=value
pairs is also an option that has precedence ) This would allow passing query params or even load the files with some other extension. Or even have additional optionshidden
,collapsed
,height
of iframe etc.== Closes issue(s) ==
== Changes ==
== Affected Packages ==
pv-stylemark