grand-stack / grandstack.io

GRANDstack website
https://GRANDstack.io
18 stars 20 forks source link

Add language indicator to each code snippet #24

Open johnymontana opened 4 years ago

johnymontana commented 4 years ago

There is a mix of Cypher, javascript, graphql typedefs vs queries, java, shell commands, etc

Add an indicator to each snippet so the reader can see clearly what language the code snippet is referencing.

Perhaps use the tabbed navigation (with a single tab) as a precursor to when we have multiple language examples (javascript and java, etc)

KazChe commented 3 years ago

Hi @johnymontana were trying to see if I can help out and was looking into how this could be implemented.

I see that Multi-language support code blocks looks to be one way to achieve within MDX pages.

However, when trying their sample code for multi-language support it causes errors during the build having to with the way blank lines are introduced to take advantage of back-tick markups to properly display a piece of code.

Then there is Tabs which does not cause errors but falls short from properly rendering a code block.

Do let me know if you had something else in mind for this enhancement and I'll be happy to play around with it.

Cheers.

KazChe commented 3 years ago

Tried with a brand new vanilla install of docusaurus classic template, and multi-lang support tabs works fine...?