接受标记并将其转换为HTML幻灯片放映。
markdown-to-presentation的Python项目详细描述
标记为演示文稿
一个构建工具,用于将标记转换为HTML演示文稿,然后发布到 GH页
安装
pip install markdown-to-presentation
用法
设置以下文件:
# Theme variables for reveal.js
assets/_theme.scss
# application-specific scss
assets/_app.scss
# copied into build directory
assets/*.png
# contains slides
slides.md
幻灯片必须用空行分隔,后跟***
和空白
行。当呈现为标记时,***
将是一个水平规则。如果你需要
幻灯片中的水平规则,请使用---
或___
。
下面是一个示例slides.md:
# Title slide ## subtitle *** ## first slide - bullet 1 - bullet 2 - bullet 3
如果幻灯片中需要原始HTML,请使用specialrawhtml
代码块:
```rawhtml
<div>this html will be <em>injected</em> directly</div>
```
一个很好的示例生成文件:
all:run-buildvenv:requirements.txt rm -rf venv virtualenv venv -ppython3.6 venv/bin/pip install -rrequirements.txt venv/bin/pre-commit install -f --install-hooks .PHONY:run-buildrun-build:venv venv/bin/markdown-to-presentation run-build .PHONY:pushpush:venv venv/bin/markdown-to-presentation push index.htm build clean: rm -rf .mtp venv build index.htm
连接推送到GitHub页面
获取具有
public_repo
权限。
使用^{GH_TOKEN=...
。你需要它吐出来的山药
填写您的.travis.yml
。
做一个.travis.yml
看起来像这样:
install:pip install virtualenvscript:makeafter_success:make pushbranches:except:-gh-pagesenv:global:# GH_TOKEN-secure:...
对于您的make push
目标,调用如下内容:
.PHONY:pushpush:venv venv/bin/markdown-to-presentation push index.htm build
可执行文件markdown-to-presentation push
接受以下参数:
$ markdown-to-presentation push --help
usage: markdown-to-presentation push [-h] [--master-branch MASTER_BRANCH]
[--pages-branch PAGES_BRANCH]
paths [paths ...]
positional arguments:
paths
optional arguments:
-h, --help show this help message and exit
--master-branch MASTER_BRANCH
--pages-branch PAGES_BRANCH