疯狂java讲义epub_为讲义创建EPUB

疯狂java讲义epub

Creating an EPUB for Workshop Notes

I enjoy teaching people about CSS and in particular CSS Layout, over the last year I’ve developed a course which, in entirety, is about two full days worth of material if taught in person.

我喜欢教人们关于CSS的知识 ,尤其是CSS布局。在过去的一年中,我开发了一门课程,如果亲自授课,整个课程大约需要两天的时间。

As there is only one of me, and I can only take on a finite number of in-person engagements each year I decided to make that material available online in the form of a self guided CSS layout workshop. Having done that, my aim was to keep all of the material in sync. So, if you study online or with me in a workshop all of the material is right up to date with any changes to the Grid specification or other fast moving specifications I cover.

由于只有我一个人,而且我每年只能进行有限的面对面交流,因此我决定以自导CSS布局研讨会的形式在线上提供这些资料。 完成此操作后,我的目标是使所有材料保持同步。 因此,如果您在线学习或与我一起在车间中学习,那么对Grid规范或我介绍的其他快速发展规范的任何更改都将使所有材料都是最新的。

It made sense to maintain the online version as the source of truth. It is the most complete version of the material – I rarely do this as a full two day workshop. So when I run a workshop I need to do two things. I need to select the lessons that I want to teach in person, and I need to assemble myself a set of teaching notes to use on the day. This post will explain how I achieved this using Perch Runway, and Pandoc.

保持在线版本为真相是有意义的。 这是材料的最完整版本–我很少进行为期两天的研讨会。 因此,当我举办一个研讨会时,我需要做两件事。 我需要选择要亲自授课的课程,还需要整理一套自己的教学笔记以供日后使用。 这篇文章将解释我如何使用Perch RunwayPandoc实现这一目标。

鲈鱼模板和我的教训 (Perch Templates and my Lessons)

Each lesson in my workshop is stored as a an item a Perch Runway Collection. Collections in Runway can be any type of data stored in a structured format, so I have one for lessons. When I created my Collection for the website content I created a Perch template, with fields for the different elements of a lesson. I’m using Perch Blocks to enable to building up of an individual lesson from various types of data, including videos and images.

我的工作室中的每个课程都作为“ Perch跑道收藏”的一个项目存储。 “跑道”中的集合可以是以结构化格式存储的任何类型的数据,因此我上一节课 。 当我为网站内容创建收藏集时,我创建了一个Perch模板,其中包含用于课程的不同元素的字段。 我正在使用Perch块来根据各种类型的数据(包括视频和图像)构建单个课程。

This master template for the Collection becomes the schema for the content, and therefore the admin UI in the Control Panel.

集合的主模板成为内容的架构,并因此成为“控制面板”中的管理UI。

I’ve also added to this template a field for notes used in the in-person version of the workshop only. As I don’t want these to display on the website I have added the suppress attribute set to true. I can now enter this content in the Perch Control Panel and store it alongside the lesson, but it won’t display when the lesson is displayed using this main template on the site.

我还在此模板中添加了一个字段,该字段仅用于研讨会的面对面版本中的注释。 由于我不希望这些内容显示在网站上,因此我添加了“抑制”属性设置为true。 现在,我可以在“ Perch控制面板”中输入此内容,并将其存储在课程旁边,但是当使用站点上的此主模板显示课程时,它不会显示。

On the CSS Workshop site I display these lessons in Categories and secure them according to which course people have purchased. You can see some of the lessons which are available as part of my free courses on Selectors and Length Units.

CSS Workshop网站上,我以类别显示这些课程,并根据人们购买的课程来确保它们的安全。 您可以查看一些课程,这些课程我关于选择器和长度单位的免费课程的一部分。

选择出口课程 (Choosing lessons for export)

Setting up a page from which to select lessons to build up an in-person course was pretty simple due to the fact that I can pass in different templates to the perch_collection function when I call it from the page – I’m not restricted to the master template used for input. The first template I pass in simply displays the title of the course, along with a checkbox to select it, the value of that checkbox is the slug for that lesson.

设置页面以从中选择课程来构建面对面的课程非常简单,因为当我从页面中调用它时,我可以将不同的模板传递给perch_collection函数 –我不限于用于输入的主模板。 我传入的第一个模板只是显示该课程的标题,以及一个用于选择它的复选框,该复选框的值就是该课程的内容。

I post that to another page which again uses the perch collection function to select the courses from the array of slugs passed to it. Then I use another template to re-present that content in a plain HTML format – this time also including those notes added in the Control Panel for in-person presentations only, and not displaying things like videos and figures that make no sense in my notes. I now have all of my notes in HTML format.

我将其发布到另一个页面,该页面再次使用鲈鱼收集功能从传递给它的子弹数组中选择课程。 然后,我使用另一个模板以纯HTML格式重新呈现该内容-这次还包括在“控制面板”中添加的注释,仅用于面对面的演示,而不显示诸如视频和图形之类的在注释中没有意义的内容。 现在,我所有的笔记都为HTML格式。

将我的文件变成EPUB (Turning my document into an EPUB)

With a nice clean HTML document of my content, I can now create my teaching notes for the workshop. When I am presenting my Macbook Pro is hooked up to the projector, with the projector mirroring the screen so the students can code along with me as we work through the CodePen examples.

有了内容的漂亮干净的HTML文档,我现在可以为研讨会创建教学笔记。 当我演讲时,我的Macbook Pro已连接到投影机,投影机将屏幕镜像到屏幕上,以便学生在进行CodePen示例时可以与我一起编码。

As I can’t have notes on the Macbook, I bring with me an iPad Mini and use that for notes. I realised when working out how best to display these notes that my iPad includes a perfect method of displaying text – iBooks – I just needed to get my notes into EPUB format and I could then take advantage of the inbuilt functionality of iBooks.

由于我在Macbook上没有笔记,因此我带了一个iPad Mini并将其用于笔记。 我意识到在研究如何最好地显示这些便笺时,我的iPad包括了一种完美的文本显示方法-iBooks-我只需要将便笺转换为EPUB格式,然后便可以利用iBooks的内置功能。

I was already aware that I could use Pandoc to convert HTML into an EPUB (which is essentially HTML in a specific structure), and so I take my exported HTML, and run it through Pandoc at the commandline:

我已经知道我可以使用Pandoc将HTML转换为EPUB (本质上是特定结构的HTML ),因此我将导出的HTML并通过Pandoc在命令行中运行:

> pandoc -o workshop.epub workshop.html --toc --toc-depth=1  > pandoc -o workshop.epub workshop.html --toc --toc-depth=1   

This creates me an EPUB, and I can open that in iBooks. A few notes on using Pandoc.

这将为我创建一个EPUB ,我可以在iBooks中打开它。 有关使用Pandoc的一些注意事项。

Pandoc will treat an h1 heading in your document as a new chapter. In my case that meant each lesson would become a chapter.

Pandoc会将文档中的h1标题视为新的章节。 就我而言,这意味着每节课将成为一章。

In the command above I have asked Pandoc to create me a table of contents, with the doc flag, and use a table of contents depth of 1 – so the TOC only includes the level ones headings. If you had longer lessons it might be helpful to output headings down to level 2 to give you more of an index.

在上面的命令中,我要求Pandoc使用doc标志创建一个目录,并使用目录深度为1的目录 -因此TOC仅包含级别标题。 如果您上了更长的课,将标题输出到第2级可能会有所帮助,以便为您提供更多的索引。

In this case I am happy just to use the default CSS styles, however you can pass a stylesheet into Pandoc using the --epub-stylesheet=book.css flag.

在这种情况下,我很高兴使用默认的CSS样式,但是您可以使用--epub-stylesheet=book.css标志将样式表传递给Pandoc。

If you do want to edit your EPUB after exporting, then I would suggest opening it in Sigil, a free EPUB editor. You can then make any edits and save the document.

如果确实要在导出后编辑EPUB ,则建议在免费的EPUB编辑器Sigil中打开它。 然后,您可以进行任何编辑并保存文档。

其他转换 (Other conversions)

As I am using content already easily output as HTML, then converting from HTML makes sense for my scenario. However if all of your notes are offline you can also convert directly from Markdown with pandoc. Also, see my notes for turning an EPUB into a Mobi for use on the Kindle, if you want to use a Kindle to present from.

当我使用已经很容易以HTML格式输出的内容时,从HTML转换对于我的情况就很有意义。 但是,如果您的所有注释都处于脱机状态,则还可以使用pandoc从Markdown直接转换。 另外,如果您想使用Kindle进行演示, 请参阅我的将EPUB转换为Mobi以便在Kindle上使用的说明。

There are lots of ways this process could be improved. I could add a method to reorder content or to add additional content as I create the book. I could install Pandoc on my server and actually run the transformation there, downloading the EPUB. However this process took me about 30 minutes to get up and running, in a hotel room, when I first thought about it. If you do find yourself needing to create notes for some purpose, then hopefully this helps you too.

有很多方法可以改进此过程。 创建书时,我可以添加一种方法来对内容进行重新排序或添加其他内容。 我可以在服务器上安装Pandoc并在那里实际运行转换,下载EPUB 。 但是,当我第一次想到这个过程时,我花了大约30分钟的时间在旅馆房间里起床并跑步。 如果您确实发现需要出于某些目的创建笔记,那么希望对您有所帮助。

翻译自: https://rachelandrew.co.uk/archives/2016/06/03/creating-an-epub-for-workshop-notes/

疯狂java讲义epub

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值