Comments (5)
Hi Joy.
reveal.js parses markdown in 2 distinct phases :
- one dedicated to classic markdown grammar with marked
- a custom one handles special comments in the source, like the ones you need to trigger fragments navigation.
Unfortunately, prez only currently takes care of the marked parsing. We'll have a look on how to parse comments properly.
from prez.
Oh, ok. Thanks, and look forward to it!
from prez.
@Delapouite I found this issue and try to deal with it,
I forked a marked repo and change the lexer grammar
xnum/marked@0b859c9
then I use __ surround to set strings with fragment
and add $class:fragment class$
on slides' heading
but I think it's not a good solution, do you have any advice on it?
from prez.
The problem about Reveal.js custom comments adding property to markdown is that this is currently done in the DOM itself : https://github.com/hakimel/reveal.js/blob/master/plugin/markdown/markdown.js#L312-L345
Prez does not compile markdown in the browser but in node, so we do not have access to the DOM. One solution could be to extract all the logic from the script aforementioned and run it in a cheerio environment but it would be really hacky.
My best advice therefore when you want to extend so much the markdown syntax, to use fragments for instance, is to simply fallback on normal HTML since it's legal syntax. This way, no need to learn a half-baked DSL.
from prez.
In order to be able to extend Markdown's syntax you can now use the parser of your choice. Example, using a CLI markdown converter:
// your-project/my-markdown-parser.js
const spawnSync = require("child_process").spawnSync
module.exports = (input) => spawnSync("maruku", { input }).stdout.toString("utf8")
// your-project/.prezrc
parser = ./my-markdown-parser
from prez.
Related Issues (20)
- sub-covers : from underscore to space HOT 3
- --stats does not work HOT 2
- Wrong syntax coloration behaviour HOT 3
- Wrong commands behavior HOT 2
- Add pandoc as markdown renderer
- Enable markdown tables of any kind
- Code Syntax Highlighting does not work consistently HOT 3
- How to set page size & resolution for PDF output?
- printing doesn't work in npm 3 HOT 1
- --watch doesn't see changes
- Consider using CDN for referenced assets HOT 2
- fs-extra upgrade
- remove such-notes options
- How to modify reveal.js used to generate the build dir? HOT 1
- Multiple slides in a single file HOT 3
- How to add 3rd party reveal js plugins to prez?
- PDF file, all pages are blank
- GitPitch support
- is prez development active/supported? HOT 3
- How to change the reference of phantomjs to phantomjs-prebuilt?
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 prez.