使用“启示录”制作很棒的“启示录”js演示文稿

revelation的Python项目详细描述


启示录

PyPIPyPI - LicensePyPI - Python VersionBuild StatusCoverage StatusCode style: black

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 ChromeChromium来描述,但是我使用Firefox得到了相同的结果。

  1. 以启示录的形式进行演示。
  2. print-pdf作为查询字符串打开浏览器,如:localhost:5000/?print-pdf
  3. 打开浏览器中的“打印”对话框(ctrl+p或cmd+p)。
  4. destination设置更改为save as pdf
  5. 布局更改为横向
  6. margins更改为none
  7. 启用背景图形选项。
  8. 单击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 separatorvertical 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标记,但某些块标记可能会出现意外行为。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
尝试连接到Red5服务器时出现java问题   java实现Runnable的类被认为是ExecutorServices的“Runnable任务”?   java struts2类中的多个@validation   java未能应用插件[class'org.gradle.api.plugins.scala.ScalaBasePlugin']:gradle v2。13   如何使用Java流仅收集长度最大的元素?   从spring引导应用程序连接到firestore的java引发空指针异常   java从SQLite插入和获取真实数据类型会为连续插入获取空值吗?   当存在未知数量的空格时,使用java替代正向查找   部署如何为当今的浏览器部署java小程序(小程序、嵌入、对象)?   @OneToMany和@ManyToOne@Formula之间的java双向关系返回null   java为什么在我的例子中,协议缓冲区的性能比JSON差?   如何部署混合C++/Java(JNI)应用程序?   java如何在程序中显示字符串的完整信息。反恐精英?   java在Hibernate中从持久性上下文中分离实体中的实体