使用Landslide基于MarkDown制作在线Slide

2025-05-25 0 30

Landsilde工具使用

Landslide是基于Google的html5slides的一个Slide生成工具,可将markdown、ReST 或者 textile文件转化成HTML5的slide。

该转化支持内联模式,即生成一个具有完整功能的HTML文件,将依赖的css等东西放入其中,很容易用来分享。

类似的还有工具还有 remark,相关gitlab项目主页:

  • https://github.com/adamzap/landslide
  • https://github.com/gnab/remark/

安装landslide

方案一 pip安装:

$pipinstalllandslide

方案二 源码安装:

$gitclonehttps://github.com/adamzap/landslide.git
$cdlandslide
$pythonsetup.pybuild
$sudopythonsetup.pyinstall

Markdown书写Slide内容

以markdown语法书写,可以参考landslide提供的示例:

  • https://github.com/adamzap/landslide/blob/master/examples/markdown/slides.md

生成PPT页面

以官方提供的markdown文本为例,文件命名为test.md,完成后执行如下命令生成HTML内容:

$landslidefile.md-i-o>test.html

命令行参数说明详见下文介绍。

可以直接在浏览器中打开观察效果:

opentest.html

支持快捷键,可左右切换slide,详见下文快捷键介绍。

使用Landslide基于MarkDown制作在线Slide

使用PrinceXML生成PDF

PrinceXML是一款将html转换为pdf的工具,提供免费带水印版试用。

下载地址:

  • http://www.princexml.com/download/

选择对应版本解压后执行脚本安装:

$shinsatll.sh

指定路径安装完毕后即可使用prince命令。

$princetest.html-otest.pdf

即可生成需要的PDF PPT文件。

Landslide快捷键及命令参数介绍

PPT页面快捷键

快捷键如下:

Press h to toggle display of help

Press left arrow and right arrow to navigate

Press t to toggle a table of contents for your presentation. Slide titles are links

Press ESC to display the presentation overview (Exposé)

Press n to toggle slide number visibility

Press b to toggle screen blanking

Press c to toggle current slide context (previous and next slides)

Press e to make slides filling the whole available space within the document body

Press S to toggle display of link to the source file for each slide

Press ‘2’ to toggle notes in your slides (specify with the .notes macro)

Press ‘3’ to toggle pseudo-3D display (experimental)

Browser zooming is supported

命令行参数介绍

landslide命令行参数介绍如下:

-h,--helpshowthishelpmessageandexit
-c,--copy-themeCopythemedirectoryintocurrentpresentationsourcedirectory
-b,--debugWilldisplayanyexceptiontracetostdin
-dFILE,--destination=FILE
Thepathtothetothedestinationfile:.htmlor.pdf
extensionsallowed(default:presentation.html)
-eENCODING,--encoding=ENCODING
Theencodingofyourfiles(defaultstoutf8)
-i,--embedEmbedstylesheetandjavascriptcontents,
base64-encodedimagesinpresentationtomakea
standalonedocument
-lLINENOS,--linenos=LINENOS
Howtooutputlinenosinsourcecode.Threeoptions
availables:no(nolinenumbers);inlineinsidepretag
table(linesnumbersinanothercell,copy-pastefriendly)
-o,--direct-outputPrintsthegeneratedHTMLcodetostdin;won'tworkwithPDFexport
-q,--quietWon'twriteanythingtostdin(silentmode)
-r,--relativeMakeyourpresentationassetlinksrelativetocurrent
pwd;Thismaybeusefulifyouintendtopublishyour
htmlpresentationonline.
-tTHEME,--theme=THEME
Athemename,orpathtoalandlsidethemedirectory
-v,--verboseWriteinformationalmessagestostdin(enabledbydefault)
-w,--watchWatchthesourcedirectoryforchangesandauto-regeneratethepresentation
-xEXTENSIONS,--extensions=EXTENSIONS
Comma-separatedlistofextensionsforMarkdown
-m,--math-outputEnablemathematicaloutputusingmathjax
收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

快网idc优惠网 建站教程 使用Landslide基于MarkDown制作在线Slide https://www.kuaiidc.com/51025.html

相关文章

发表评论
暂无评论