deckgo / gatsby-remark-highlight-code

Adds stylish cards and syntax highlighting to code blocks in markdown files
MIT License
68 stars 18 forks source link

highlight-code layout showing but the code is not visible (Gatsby) #24

Closed michael-parvaneh closed 4 years ago

michael-parvaneh commented 4 years ago

I've set up everything correctly as I've run through them multiple times looking for a mistake somewhere, but there's nothing I can find, the same issue is showing up on the deckdeckgo docs in the "Install DeckDeckGo Highlight Code from NPM" section. It's not showing the "npm install" command. Inside the shadow-root, it correctly points to the but I'm not able to see the code.

peterpeterparker commented 4 years ago

I suggest you to go through the README steps Install, Configure and Load the component again.

After you have executed all these steps, for sure let me know if it still doesn't work or if it does. If it does not, can you please also submit a link to your repo or to a sample repo.

michael-parvaneh commented 4 years ago

I suggest you to go through the README steps Install, Configure and Load the component again.

After you have executed all these steps, for sure let me know if it still doesn't work or if it does. If it does not, can you please also submit a link to your repo or to a sample repo.

sure, I will try to reproduce the error. there's also an error I'm receiving in chrome console I'll paste it here maybe it'll help: Uncaught (in promise) TypeError: Cannot read property 'require' of undefined at DeckdeckgoHighlightCode.initLanguagesToLoad (deckgo-highlight-code.entry.js:2143) at DeckdeckgoHighlightCode.loadLanguages (deckgo-highlight-code.entry.js:2134) at DeckdeckgoHighlightCode.componentDidLoad (deckgo-highlight-code.entry.js:2075)

peterpeterparker commented 4 years ago

Both are related, you might have missed a step of the documentation. Let me know the outcome.

michael-parvaneh commented 4 years ago

I changed ```js console.log('hello')``` to ```javascript console.log('hello') ``` inside the .md file and it fixed the issue I also was able to fix it by changing the language attrib on deckdeckgo highlight-code component from js to javascript, was I supposed to use "javascript" instead of "js" from the beginning?

peterpeterparker commented 4 years ago

Cool to hear you solved your issue 👍

The component use Prismjs under the hood and indeed right now it does not support alias such as js

But that can be an enhancement. You are most welcomed to open an issue in our main repo and even send us a PR if you have time 😉.