在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):webpro/reveal-md开源软件地址(OpenSource Url):https://github.com/webpro/reveal-md开源编程语言(OpenSource Language):JavaScript 90.2%开源软件介绍(OpenSource Introduction):reveal-mdreveal.js on steroids! Get beautiful reveal.js presentations from Markdown files. Installationnpm install -g reveal-md Usagereveal-md slides.md This starts a local server and opens any Markdown file as a reveal.js presentation in the default browser. DockerYou can use Docker to run this tool without needing Node.js installed on your machine. Run the public Docker image, providing your markdown slides as a volume. A few examples: docker run --rm -p 1948:1948 -v <path-to-your-slides>:/slides webpronl/reveal-md:latest
docker run --rm -p 1948:1948 -v <path-to-your-slides>:/slides webpronl/reveal-md:latest --help The service is now running at http://localhost:1948. To enable live reload in the container, port 35729 should be mapped as well: docker run --rm -p 1948:1948 -p 35729:35729 -v <path-to-your-slides>:/slides webpronl/reveal-md:latest /slides --watch Features
MarkdownThe Markdown feature of reveal.js is awesome, and has an easy (and configurable) syntax to separate slides. Use three
dashes surrounded by two blank lines ( # Title
- Point 1
- Point 2
---
## Second slide
> Best quote ever.
Note: speaker notes FTW! Code sectionSyntax highlighting```js
console.log('Hello world!')
``` Highlight some linesYou can highlight one line, multiple lines or both. ```python [1|3-6]
n = 0
while n < 10:
if n % 2 == 0:
print(f"{n} is even")
else:
print(f"{n} is odd")
n += 1
``` ThemeOverride theme (default: reveal-md slides.md --theme solarized See available themes. Override reveal theme with a custom one. In this example, the file is at reveal-md slides.md --theme theme/my-custom.css Override reveal theme with a remote one (use rawgit.com because the url must allow cross-site access): reveal-md slides.md --theme https://rawgit.com/puzzle/pitc-revealjs-theme/master/theme/puzzle.css Highlight ThemeOverride highlight theme (default: reveal-md slides.md --highlight-theme github See available themes. Custom Slide SeparatorsOverride slide separator (default: reveal-md slides.md --separator "^\n\n\n" Override vertical/nested slide separator (default: reveal-md slides.md --vertical-separator "^\n\n" Custom Slide AttributesUse the reveal.js slide attributes functionality to add HTML attributes, e.g. custom backgrounds. Alternatively,
add an HTML Example: set the second slide to have a PNG image as background: # slide1
This slide has no background image.
---
<!-- .slide: data-background="./image1.png" -->
# slide2
This one does! reveal-md OptionsDefine options similar to command-line options in a {
"separator": "^\n\n\n",
"verticalSeparator": "^\n\n"
} Reveal.js OptionsDefine Reveal.js options in a {
"controls": true,
"progress": true
} Speaker NotesUse the speaker notes feature by using a line starting with YAML Front matterSet Markdown (and reveal.js) options specific to a presentation with YAML front matter: ---
title: Foobar
separator: <!--s-->
verticalSeparator: <!--v-->
theme: solarized
revealOptions:
transition: 'fade'
---
Foo
Note: test note
<!--s-->
# Bar
<!--v--> Live ReloadUsing reveal-md slides.md -w Custom ScriptsInject custom scripts into the page: reveal-md slides.md --scripts script.js,another-script.js
Custom CSSInject custom CSS into the page: reveal-md slides.md --css style.css,another-style.css
Custom FaviconIf the directory with the markdown files contains a Pre-process Markdown
For example, to have headers automatically create new slides, one could have the script // headings trigger a new slide
// headings with a caret (e.g., '##^ foo`) trigger a new vertical slide
module.exports = (markdown, options) => {
return new Promise((resolve, reject) => {
return resolve(
markdown
.split('\n')
.map((line, index) => {
if (!/^#/.test(line) || index === 0) return line;
const is_vertical = /#\^/.test(line);
return (is_vertical ? '\n----\n\n' : '\n---\n\n') + line.replace('#^', '#');
})
.join('\n')
);
});
}; and use it like this reveal-md --preprocessor preproc.js slides.md Print to PDFThere are (at least) two options to export a deck to a PDF file. 1. Using PuppeteerCreate a (printable) PDF from the provided Markdown file: reveal-md slides.md --print slides.pdf The PDF is generated using Puppeteer. Alternatively, append By default, paper size is set to match options in your reveal-md slides.md --print slides.pdf --print-size 1024x768 # in pixels when no unit is given
reveal-md slides.md --print slides.pdf --print-size 210x297mm # valid units are: px, in, cm, mm
reveal-md slides.md --print slides.pdf --print-size A4 # valid formats are: A0-6, Letter, Legal, Tabloid, Ledger In case of an error, please try the following:
2. Using Docker & DeckTapeThe first method of printing does not currently work when running reveal-md in a Docker container, so it is recommended that you print with DeckTape instead. Using DeckTape may also resolve issues with the built-in printing method’s output. To create a PDF of a presentation using reveal-md running on your localhost using the DeckTape Docker image, use the following command: docker run --rm -t --net=host -v $OUTPUT_DIR:/slides astefanutti/decktape $URL $OUTPUT_FILENAME Replace these variables:
For a full list of export options, please see the the DeckTape github, or run the Docker container with the Static WebsiteThis will export the provided Markdown file into a stand-alone HTML website including scripts and stylesheets. The files
are saved to the directory passed to the reveal-md slides.md --static _site This should copy images along with the slides. Use reveal-md slides.md --static --static-dirs=assets Providing a directory will result in a stand-alone overview page with links to the presentations (similar to a directory listing): reveal-md dir/ --static By default, all reveal-md dir/ --static --glob '**/slides.md' Additional reveal-md slides.md --static _site --absolute-url https://example.com --featured-slide 5 Disable Auto-open BrowserTo disable auto-opening the browser: reveal-md slides.md --disable-auto-open Directory ListingShow (recursive) directory listing of Markdown files: reveal-md dir/ Show directory listing of Markdown files in current directory: reveal-md Custom PortOverride port (default: reveal-md slides.md --port 8888 Custom TemplateOverride reveal.js HTML template (default template): reveal-md slides.md --template my-reveal-template.html Override listing HTML template (default template): reveal-md slides.md --listing-template my-listing-template.html Scripts, Preprocessors and PluginsRelated Projects & Alternatives
Articles About reveal-md
Thank YouMany thanks to all contributors! License |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论