跳转到主要内容

将markdown转换为html幻灯片。

项目描述

pre-commit.ci status

markdown-to-presentation

一个构建工具,将markdown转换为html演示文稿,然后发布到gh-pages

安装

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

幻灯片必须由一个空白行后面跟着***然后是另一个空白行来分隔。当以markdown渲染时,***将是一个水平线。如果您需要在幻灯片中使用水平线,请使用---___代替。

以下是一个示例slides.md

# Title slide
## subtitle

***

## first slide

- bullet 1
- bullet 2
- bullet 3

如果您需要在幻灯片中使用原始html,请使用一个特殊rawhtml代码块

```rawhtml
<div>this html will be <em>injected</em> directly</div>
```

一个与该工具配合良好的示例makefile

all: run-build

venv: requirements.txt
    rm -rf venv
    virtualenv venv -ppython3
    venv/bin/pip install -rrequirements.txt
    venv/bin/pre-commit install -f --install-hooks

.PHONY: run-build
run-build: venv
    venv/bin/markdown-to-presentation run-build

.PHONY: push
push: venv
    venv/bin/markdown-to-presentation push index.htm build

clean:
    rm -rf .mtp venv build index.htm

将push与github pages连接起来

获取一个具有public_repo权限的push令牌

使用travis encrypt将您的push令牌加密为GH_TOKEN=...。您需要yaml输出的内容来填写您的.travis.yml文件。

创建一个类似下面的.travis.yml文件

install: pip install virtualenv
script: make
after_success: make push
branches:
    except:
        - gh-pages
env:
    global:
        # GH_TOKEN
        - secure: ...

对于您的make push目标,调用以下内容

.PHONY: push
push: venv
    venv/bin/markdown-to-presentation push index.htm build

请参阅markdown-to-presentation push --help以获取完整的选项列表。

项目详情


下载文件

下载您平台上的文件。如果您不确定选择哪一个,请了解更多关于 安装包的信息

源代码分发

markdown_to_presentation-0.0.34.tar.gz (7.1 kB 查看哈希值)

上传时间 源代码

构建分发

markdown_to_presentation-0.0.34-py2.py3-none-any.whl (7.7 kB 查看哈希值)

上传时间 Python 2 Python 3

由以下支持