Comments (5)
Hi @ivan-kleshnin! Sorry this went unanswered for a while!
I think that’s a pretty good idea, but I feel it’s better suited as a standalone plugin. Maybe even for rehype itself? Feel free to chat about that on Gitter, if you’re interested in building it!
Cheers,
Titus
from remark-highlight.js.
Hi, Titus. No problem. I plan to invest some time in rehype ecosystem in the future because of my main project (which is turning into something quite markdown-based). You've made a lot of interesting thematic libraries – I should admit... So I'll definitely consider to create this plugin.
Cheers!
from remark-highlight.js.
Thanks for the kind words! I hope you’ll try it out, let me know if I can help!
from remark-highlight.js.
Hi
I was looking to impement the same feature so I wrote this:
https://github.com/babakfp/remark-inline-code-language
But, it seems like I should've made the plugin for rehype because I don't get back the lang
property in this example:
import { unified } from "unified"
import { visit } from "unist-util-visit"
import remarkParse from "remark-parse"
import remarkInlineCodeLanguage from "../../remark-inline-code-language/dist/index.js"
import remarkRehype from "remark-rehype"
import rehypeStringify from "rehype-stringify"
const file = await unified()
.use(remarkParse)
.use(remarkInlineCodeLanguage)
.use(remarkRehype)
.use(() => {
return (tree, file) => {
visit(tree, "element", function visitor(node) {
console.log(JSON.stringify(node, null, 4))
})
}
})
.use(rehypeStringify)
.process("`_js console.log()`")
Is that correct? Do I need to build it for rehype or what can I do?
Thanks
from remark-highlight.js.
Welcome @babakfp!
That is not what this thread is about, it is about a different, plain HTML syntax.
This tread is also over 6 years old, the project has changed and evolved over the years.
I'd recommend opening a thread in discussions (https://github.com/orgs/remarkjs/discussions) and offering a bit more context on your goal.
The original suggestion that rehype would likely be involve may still holds true #26 (comment)
But more context can help clarify.
I'm going to lock this thread as it's outdated, and this new conversation is unrelated to the original thread.
But happy to continue the conversation in discussions (https://github.com/orgs/remarkjs/discussions)
from remark-highlight.js.
Related Issues (10)
- Remove `highlight.js` dependency HOT 2
- Update mdast to remark HOT 6
- Maintaining position information? HOT 2
- Use in Vue and Webpack HOT 3
- Not working with Next Js SSG HOT 9
- Unknown language: `j` is not registered HOT 1
- Option to ignore unknown languages HOT 6
- highlight.js v11 support? HOT 1
- Missing styles HOT 2
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 remark-highlight.js.