Comments (11)
Ok I tried to follow base on what the ReadMe says.
-
First I install the extension in my gatsby project via:
npm install mathiasfrohlich/vscode-kotlin
-
Add it in my gatsby-config.js
{
resolve: `gatsby-remark-vscode`,
options: {
theme: 'Default Dark+', // Or install your favorite theme from GitHub
extensions: ['Kotlin'] //This is from the name in package.json
}
},
Then made a simple script with kotlin as lanugage inside my markdown file:
```kotlin
//Test Script
fun fibonacci(num){
var a = 1, b = 0, temp;
while (num >= 0){
temp = a;
a = a + b;
b = temp;
num--;
}
return b;
}
Still the language not detected, am I missing something?
from gatsby-remark-vscode.
Ah, ok, I guess there is a bug here. The problem is that extension registers both kotlin
and koltinscript
under the same scope name, which I thought was impossible. Language registrations are stored in a dictionary keyed by scope name, and so kotlinscript is overwriting kotlin. In the meantime, ```kotlinscript
or ```kts
works. As far as I know, it should work identically since they’re registering under the exact same configuration.
from gatsby-remark-vscode.
You’re right, the README needs an update. To answer your question though, all it should take is to install the extension and list it in the extensions
array. Then any languages that extension contributes should Just Work™ with whatever code fence tags they register (e.g. ```dart
or ```kotlin
).
from gatsby-remark-vscode.
I'm confuse where to register these "code fence tags" to be detected by the gatsby-remark-vscode? It is something via alias in gatsby-config or automatically made from the extension developer?
from gatsby-remark-vscode.
It’s from the extension developer, e.g. here. I do think it’s unfortunate that it’s not easier to find out what the possible strings are, which is why I have #90 on the backlog.
from gatsby-remark-vscode.
Cool thanks it is working now!!
from gatsby-remark-vscode.
README still needs some work 😄
from gatsby-remark-vscode.
Thanks @garlen-javier @andrewbranch, was looking for kotlin syntax support for a while. you save my time!
from gatsby-remark-vscode.
Hi @andrewbranch Im working with gatsby 4 and remark vscode 3.3.1, this still not work in my kotlin code. Im using mdx for blog type
{
resolve: `gatsby-plugin-mdx`,
options: {
extensions: [".mdx", ".md"],
remarkPlugins: [
require("gatsby-remark-vscode").remarkPlugin,
{
theme: "Default Dark+",
extensions: ["Kotlin"],
},
],
```kotlinscript
fun fibonacci(num){
var a = 1, b = 0, temp;
while (num >= 0){
temp = a;
a = a + b;
b = temp;
num--;
}
return b;
from gatsby-remark-vscode.
I also tried adding support for Dart, which unfortunately does not seem to work:
remarkPlugins: [
[
require('gatsby-remark-vscode').remarkPlugin,
{
theme: {
default: 'Material Theme',
// dark: '',
},
inlineCode: {
marker: '•',
theme: {
default: 'Material Theme',
// dark: 'Default Dark+',
},
},
extensions: [`${__dirname}/vendor/material-theme.vsix`, 'Dart'],
},
],
Also tried simply:
remarkPlugins: [
[
require('gatsby-remark-vscode').remarkPlugin,
{
extensions: ['Dart'],
},
],
]
But it bugs out with error:
Error: Cannot find module 'Dart/package.json'
Using ^3.3.0
from gatsby-remark-vscode.
@andrewbranch would you have any suggestions? Stumbled upon #69 - not sure if it's related
from gatsby-remark-vscode.
Related Issues (20)
- option to show line numbers by default
- Feature request: Support for plaintext within inline code and consider plain text as default when no marker is set
- Version 3 Fails with ‘UNHANDLED REJECTION createNodeId is not a function’ HOT 3
- Not able to add additional languages HOT 2
- Multiple language registrations can have the same scope/config
- Feature request: Title Header for the Script Name HOT 1
- Add horizontal scroll, have problems with longer code HOT 1
- sv language support HOT 1
- highlighting doesn't working with custom MDXProvider, MDXRenderer HOT 3
- Table layout causes diff and line highlight errors HOT 3
- Update for gatsby v3 HOT 11
- Passing arbitrary props directly with code fence options HOT 4
- Non-Gatsby Remark Plugin in MDSveX HOT 2
- When used without gatsby, injects styles when neither code spans nor code blocks have been found
- How to use the GitHub VSCode theme HOT 2
- Gatsby 4: Type with name "GRVSCCodeSpan" does not exists HOT 8
- Remove Gatsby peer dependencies HOT 3
- How to add Language Support for extensions not on NPM? HOT 1
- Comments in highlighted sections are stripped
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-remark-vscode.