使用“启示录”制作很棒的“启示录”js演示文稿
revelation的Python项目详细描述
启示录
revelation是一个cli工具 制作您的reveal.js演示文稿 很好和容易使用降价和服务当地。
功能
- 本地演示服务器,即使没有连接也可以运行演示文稿。
- 用一个命令创建样板演示文稿。
- 自定义CSS主题支持。
- 导出到静态HTML工具。
- 更改标记时浏览器实时重新加载演示文稿。
安装
您可以从pypi安装它:
$ pip install revelation
用法
安装/更新reveal.js文件
在安装启示录之后,你要做的第一件事就是下载 安装reveal.js以呈现演示文稿。
为此,只需运行installreveal
命令:
$ revelation installreveal
运行演示文稿
开始演示文稿运行:
$ revelation start PRESENTATION
PRESENTATION
是标记表示文件的路径。
创建新演示文稿
创建新的演示文稿运行:
$ revelation mkpresentation NAME
它将创建一个新的演示文稿文件夹,并传递NAME
。
静态导出
要将演示文稿导出为静态HTML内容,请使用以下命令:
$ revelation mkstatic PRESENTATION
PRESENTATION
是标记表示文件的路径。
pdf导出
演示文稿可以通过特殊的打印样式表导出为pdf格式。这个特性将使用Google Chrome或Chromium来描述,但是我使用Firefox得到了相同的结果。
- 以启示录的形式进行演示。
- 用
print-pdf
作为查询字符串打开浏览器,如:localhost:5000/?print-pdf
。 - 打开浏览器中的“打印”对话框(ctrl+p或cmd+p)。
- 将destination设置更改为save as pdf。
- 将布局更改为横向。
- 将margins更改为none。
- 启用背景图形选项。
- 单击save。
或者可以使用decktape项目。
使用Ngrok
共享演示文稿您可以使用Ngrok轻松共享演示文稿。下载它,并将二进制文件放在根目录下。然后您可以:
$ ngrok http 5000
假设5000
是您的本地主机。
ngrok
将创建到本地主机的安全隧道:
ngrok by @inconshreveable (Ctrl+C to quit) Tunnel Status online Version 2.0.19/2.1.1 Web Interface http://127.0.0.1:4040 Forwarding http://323744c6.ngrok.io -> localhost:5000 Forwarding https://323744c6.ngrok.io -> localhost:5000 Connections ttl opn rt1 rt5 p50 p90 000.00 0.00 0.00 0.00
演示文稿设置
启示录在你的演示文件夹里检查了三件事。
“slides.md”文件
这是用markdown编写的演示文件,其中包含markdown section中描述的一些特殊标记,并放在演示根文件夹中。
通过将slide separator和vertical slide separator设置为reveal_config来拆分幻灯片。默认分隔符是---
和---~
。
“媒体”文件夹
演示文稿中使用的所有图像都放在'media'文件夹中,并从演示文稿根目录开始在幻灯片中引用。
![Python Logo](img/python.png)
“主题”文件夹
您可以创建自定义主题文件并将其放在'theme'文件夹中,然后在配置文件中引用它。
“config.py”文件
配置文件位于演示文稿根文件夹中,负责自定义演示文稿。
此文件是可选的,可以更改上面的值:
reveal\u meta:显示元数据的python字典
REVEAL_META={# Title of the slide'title':'The title',# Author in the metadata of the slide'author':'Some Author',# Description in the metadata of the slide'description':'Some description'}
显示主题:选择显示主题的字符串
# Themes# beige, black, blood, league, moon, night, serif, simple, sky,# solarized, whiteREVEAL_THEME='black'
显示配置:带有reveal.js configuration attributes但使用python类型的python字典(例如:true是python boolean true)
REVEAL_CONFIG={# Slide separator'slideSep':'---',# Display controls in the bottom right corner'controls':True,# Display a presentation progress bar'progress':True,# Display the page number of the current slide'slideNumber':False,# Push each slide change to the browser history'history':True,# Enable keyboard shortcuts for navigation'keyboard':True,# Enable the slide overview mode'overview':True,# Vertical centering of slides'center':True,# Enables touch navigation on devices with touch input'touch':True,# Loop the presentation'loop':False,# Change the presentation direction to be RTL'rtl':False,# Turns fragments on and off globally'fragments':True,# Flags if the presentation is running in an embedded mode,# i.e. contained within a limited portion of the screen'embedded':False,# Flags if we should show a help overlay when the questionmark# key is pressed'help':True,# Flags if speaker notes should be visible to all viewers'showNotes':False,# Number of milliseconds between automatically proceeding to the# next slide, disabled when set to 0, this value can be overwritten# by using a data-autoslide attribute on your slides'autoSlide':0,# Stop auto-sliding after user input'autoSlideStoppable':True,# Enable slide navigation via mouse wheel'mouseWheel':False,# Hides the address bar on mobile devices'hideAddressBar':True,# Opens links in an iframe preview overlay'previewLinks':False,# Transition style# default/cube/page/concave/zoom/linear/fade/none'transition':'default',# Transition speed'transitionSpeed':'default',# default/fast/slow# Transition style for full page slide backgrounds# default/none/slide/concave/convex/zoom'backgroundTransition':'default',# Number of slides away from the current that are visible'viewDistance':3,# Parallax background image# e.g.:# "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"'parallaxBackgroundImage':'',# Parallax background size'parallaxBackgroundSize':'',# CSS syntax, e.g. "2100px 900px"# Amount to move parallax background (horizontal and vertical)# on slide change# Number, e.g. 100'parallaxBackgroundHorizontal':'','parallaxBackgroundVertical':'',}
降价
演示文件上使用的标记支持大多数GitHub Markdown,并添加了一些特殊的html注释ta用于编辑在reveal.js markdown docs上解释的样式和控件效果。
重要信息:您可以在演示文稿文件上使用所有HTML标记,但某些块标记可能会出现意外行为。