Replies: 2 comments
-
I may not be able to provide a good solution due to less your contexts about the uncommon combination, Marpit + WebSlides. Please enhance the quality of question with reference to https://stackoverflow.com/help/how-to-ask. Providing a reproducible example would be good to look for the cause. Common advice for general Marp tool
|
Beta Was this translation helpful? Give feedback.
-
Hi @yhatt, I have an application which is built with Parcel. In my import { Marpit, Element } from '@marp-team/marpit'
import 'webslides/static/css/webslides.css'
const fs = require('fs')
const marpit = new Marpit({
container: [new Element('article', { id: 'webslides' })],
})
marpit.markdown.renderer.rules.marpit_slide_open = (t, i, opts, _, self) =>
`${self.renderToken(t, i, opts)}<div class="wrap size-80">`
marpit.markdown.renderer.rules.marpit_slide_close = () => '</div></section>'
const markdown = fs.readFileSync('presentation.md', 'UTF-8').trim()
const { html } = marpit.render(markdown)
document.getElementById('main').innerHTML = html
// Initialize WebSlides
require('webslides')
const ws = new WebSlides() As you can see, I have a My <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Marp and Webslides</title>
<link rel="stylesheet" href="style/style.scss" />
</head>
<body>
<main id="main" role="main"></main>
<script src="src/index.js"></script>
</body>
</html> Here is my {
"name": "webslide-marp-presentation",
"version": "1.0.0",
"description": "A Template for Webslides and Marp",
"main": "index.html",
"author": "PRISMA European Capacity GmbH",
"license": "MIT",
"private": true,
"dependencies": {
"@marp-team/marp-core": "^1.3.0",
"@marp-team/marpit": "1.6.1",
"webslides": "^1.5.0"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"node-sass": "^4.14.1",
"parcel-bundler": "^1.12.4",
"sass": "^1.26.5",
"typescript": "^3.9.3"
},
"scripts": {
"start": "parcel index.html --open",
"build": "parcel build --public-url '.' index.html"
}
} So as mentioned in my first post, I have an additional folder |
Beta Was this translation helpful? Give feedback.
-
My images are within an
img
- folder in the top-level of my application.The markdown
![image-name](local/path/to/my/image)
does only work with internet URL.I used
marpit
together with Webslides.Am I doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions