Comments (6)
I just confirmed markdownIt({ html: true }).use(markdownItPrism)
works correctly in the sample repo.
hmsk/frontmatter-markdown-loader-nuxt-sample#2
I guess you missed to provide a stylesheet which markdown-it-prism
requires.
The plugin will insert the necessary markup into all code blocks. Include one of Prismβs stylesheets in your HTML to get highlighted code.
https://github.com/jGleitz/markdown-it-prism
In Nuxt, adding prismjs/themes/prism.css
(this referrs node_modules/prismjs/...
) in css
block on nuxt.config.(ts|js)
is the quickest way.
from frontmatter-markdown-loader.
Thanks for looking into this @hmsk . I did have the stylesheet required by markdown-it-prism
. I checked your code and it still didn't work.
However, I was able to solve it doing the following:
var md = require("markdown-it")({html:true}).use(require("markdown-it-prism"));
css: [
'prismjs/themes/prism-vsc-dark-plus.css',
],
build: {
extend(config, ctx) {
config.module.rules.push({
test: /\.md$/,
include: [
path.resolve(__dirname, "content"),
],
loader: "frontmatter-markdown-loader",
options: {
mode: [Mode.VUE_COMPONENT],
markdown: body => {
return md.render(body);
}
}
});
}
So for some reason that is not clear to me it did not work using the markdownIt
options when extending the webpack config. But it worked when using the markdown
option. This is however not the way is shown in the documentation. Maybe you can clarify?
Thank you
from frontmatter-markdown-loader.
As we can see the actual working example hmsk/frontmatter-markdown-loader-nuxt-sample#2 (comment) on our browser, I think it's just your local's trouble.
Happy to look into more if you provide a reproducible repository π
from frontmatter-markdown-loader.
Closing this issue since we don't have any discussion over a week. I welcome to reopen when a reproducible repository is provided.
from frontmatter-markdown-loader.
I found the missing piece between us. I found the object by require('markdown-it')
doesn't work for markdownIt
option. However, my codes in sample repo were using import MarkdownIt from 'markdown-it'
. The root problem is fixed in https://github.com/hmsk/frontmatter-markdown-loader/releases/tag/v3.6.0 π
from frontmatter-markdown-loader.
Thanks for looking into this @hmsk (and apologies for the late reply have been busy with other things). I will take a look at the changes this week and will let you know if I still run into some issues. This looks very promising though, thanks again.
from frontmatter-markdown-loader.
Related Issues (20)
- Pure date gets parsed into UTC timestamp HOT 1
- How can we access the markdown attributes right from nuxt.config.js? HOT 1
- Vue component appears to be parsing mustache tags within code snippets HOT 5
- component HOT 1
- How can we enable code highlighting for markdown ? HOT 1
- How to install highlight.js with frontmatter-markdown-loader ? HOT 1
- Missing line breaks in code snippet HOT 5
- Cannot stringify POJOs with symbolic keys Symbol(Symbol.toStringTag) HOT 1
- How to use within a nuxt payload dynamic route HOT 1
- Using the dynamic example B, I am unable to render local components in markdown HOT 2
- Any way of using dynamic data from database for vue components?
- Is there a way to get last modified date and time of md file HOT 2
- Action Required: Fix Renovate Configuration
- vue: Unknown custom element from .md HOT 3
- Using style-tag breaks .md file HOT 5
- Vue component mode doesn't work on Vue 3 project due to this plugin is stuck on Vue 2 compiler; `vue-template-compiler` HOT 9
- Jest Transformer for the Loader
- Dependency Dashboard
- how to set attributes
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 frontmatter-markdown-loader.