dennisreimann / uiengine

Workbench for UI-driven development
https://uiengine.uix.space/
MIT License
366 stars 25 forks source link

Support syntax highlighting for other languages #36

Closed k-was closed 5 years ago

k-was commented 5 years ago

Is your feature request related to a problem? Please describe. It looks like at the moment, only javascript syntax highlighting is supported

Describe the solution you'd like Is there a way to to enable other languages such as Go, Java, etc.

If this feature does already exist here is what happens when I try to change the language (Go in this example)

Screen Shot 2019-04-03 at 2 08 01 PM

and then here is the js (javascript example)

Screen Shot 2019-04-03 at 2 08 55 PM

I have noticed that highlight-js does support Go and other languages. https://highlightjs.readthedocs.io/en/latest/css-classes-reference.html

I wonder If I am doing something wrong.

dennisreimann commented 5 years ago

To make the js bundle as small as possible I have limited the list of supported languages to the ones that have an accompanying adapter.

Can you elaborate on your use case, especially why you need the code samples to work for languages like Go or Java? How are they related to the UI layer?

k-was commented 5 years ago

Ok so I understand the scope of this project more now. I see this is meant for documentation for UI frameworks. I liked the layout and ease of creating markdown documentation and my use case would be documenting APIs written in Go and Java. I know Mkdocs is pretty popular for this but I thought your UI styling was more appealing.

dennisreimann commented 5 years ago

Ah alright, I see. You are right, that‘d be a valid angle to use the project and that‘s what I did for the UIengine docs as well.

Nevertheless I think there might be better options out there for what you are trying to achieve. Those options might offer more automation and flexibility for documenting APIs. I don‘t know about language specific tools in Go or Java, but I‘d take a look at project like Assemble, which is Markdown based to.

I‘m saying this because I think the UIengine might not be the best fit here and the focus is indeed improving and automating the UI layer documentation.

k-was commented 5 years ago

Thanks so much, I will be looking into Assemble

therealpecus commented 5 years ago

I'll push for a reopening, in order to include at least all of UI styling languages: SCSS/SASS, LESS, STYLUS on top of CSS.

I understand the need to cut down on the bundle size, but with highlightjs natively integrated in the component lifecycle, adding languages cannot be easily patched on a runtime version of UIengine, but only at build time.

dennisreimann commented 5 years ago

@therealpecus Alright, I‘ll add these :)

dennisreimann commented 5 years ago

@therealpecus can you elaborate on your use case a bit? Are you using a custom adapter and exposing SASS/SCSS or else as a part so that they are shown in the components code tab? Where else would you need the extended hightlighted languages support?

therealpecus commented 5 years ago

We are documenting a DS that uses styles written in SASS. The coding convention docs (in markdown) have extensive examples in SCSS, for which syntax highlighting would be nice. The other case I can think of is with VueJs for which there already is an adapter.