leadingfellows / revealjs_starterkit
reveal.js 的入门套件
0.3
2019-04-02 18:47 UTC
Requires
- composer/installers: ^1.2
- cweagans/composer-patches: ^1.6
- fxp/composer-asset-plugin: ^1.4
- npm-asset/reveal.js: ^3.7
- oomphinc/composer-installers-extender: ^1.1
- wikimedia/composer-merge-plugin: ^1.4
This package is auto-updated.
Last update: 2024-09-29 05:42:13 UTC
README
1. 安装
使用 composer create-project
composer create-project leadingfellows/revealjs_starterkit -s dev -nv INSTALLATION_DIRECTORY
2. 运行
使用提供的 shell 脚本运行
./serve.sh
如何指定监听端口?
./serve.sh --port=8222
3. 使用
编辑 "custom" 子目录中的文件。
custom/index.html
此文件必须包含 HTML 部分标签,每个部分都是一个 reveal.js 幻灯片。
<section>
<h2>slide 1</h2>
</section>
<section>
<h2>slide 2</h2>
</section>
..
您可以将部分包含在其他文件中,如下所示
** custom/index.html **
<section>
<h2>slide 1</h2>
</section>
<section data-external-replace="included.html"> </section>
** custom/included.html **
<section>
<h2>slide 2</h2>
</section>
custom/inline.html
此文件的内容将被插入主文档的主体中。默认情况下,我们将标题和页脚放入其中
<div id="hidden" style="display:none;">
<div id="header">
<div id="header-left">
<div style="margin-left: 20px; margin-bottom: 20px; font-size: 0.5em;"/>
reveal.js starterkit
</div>
</div>
<div id="header-right">
<div style="margin-left: 20px; margin-bottom: 20px; font-size: 0.5em;"/>
reveal.js starterkit
</div>
</div>
<div id="footer-left">
<div style="margin-left: 20px; margin-bottom: 20px; font-size: 0.5em;"/>
reveal.js starterkit
</div>
</div>
</div>
</div>
custom/css/custom.css
此文件包含您的自定义 CSS 代码
custom/js/custom.js
此文件包含您的自定义 JS 代码。您可以使用它来更新文档标题
//inlined code
console.log("custom javascript code aded to reveal.js");
$( document ).ready(function() {
console.log("set document title");
$(this).attr("title", "Reveal.js starterkit TITLE");
});
4. 手动安装
克隆代码
克隆存储库或使用以下命令创建项目而不安装包
composer create-project leadingfellows/revealjs_starterkit -s dev -nv --no-install INSTALLATION_DIRECTORY
切换到您的目录
安装依赖项(不运行脚本)
composer install --no-scripts
配置 reveal.js
cd reveal.js && npm install
重新配置
composer run relink
手动运行
npm start -- --port=8222