Open-EO / openeo.org

openeo.org landing page
https://openeo.org
Apache License 2.0
6 stars 16 forks source link

Develop component to show examples in multiple languages (tabs) #28

Closed m-mohr closed 3 years ago

m-mohr commented 3 years ago

Develop component to show examples in multiple languages (tabs)

cc @jonathom

m-mohr commented 3 years ago

So there's a plugin for this, which can be used as follows in Markdown:

<CodeSwitcher :languages="{py:'Python', r:'R', js:'JavaScript'}">
<template v-slot:py>

```python
# Bye world in Python 3
print("Bye World")



The newlines after `<template>` and before `</template>` are required for correct rendering of Markdown.

I've asked the developer whether it's possible to avoid the repetitive ` :languages="{py:'Python', r:'R', js:'JavaScript'}"`, see https://github.com/padarom/vuepress-plugin-code-switcher/issues/5 - so maybe it gets a bit simpler soon. For now, just copy & paste it and we can remove it later again, if they choose to implement it.

@jonathom 
m-mohr commented 3 years ago

Closing here, as there's no ToDo anymore for me. Mentioned in #16 instead so that there's a reference to the related PR.