With the bulk translation of the markdown file to HTML done, the next step is to format the slides. Therefore, wherever you have the code, make sure you add it to your path. This code is assuming that the presentation is not in the same directory as the code. The program is used with the following command line: The program file has to be made executable with: This Ruby code performs the actions as described. # Get the slide presentation parts loaded. Therefore, the basic formula for creating the slide show is: copy the presbegin.html, generate HTML from the markdown, translate all tags to, fix all picture tags to use the subtext as classes, and copy the presend.html.Ĭreate a new file called pres.rb and place this code: #!/usr/bin/ruby Also, the markdown code for horizontal rules is used to separate slides. Since markdown has an anchor type for pictures, that tag is used with one difference: instead of having a text description for the picture, that area will describe the classes to attach to the picture. The only special formatting needed in the markdown notes is for any pictures and for detailing the end of each slide. Not much! It closes out the last slide’s divs and the body and html tags. Create a file called presend.html and place the following code: The sections help format everything in each slide section, while the individual slide contains formatting for that slide. Inside of the container is the section0 div and it’s slide div. The container div contains the entire slide show. The body of the HTML has a three divs: container div, section0 div, and a slide div. The beginning and ending sections get copied in, while the slides HTML gets generated by kramdown with some extra clean-up work.Ĭreate a file called presbegin.html with this code: The slideshow page has a beginning HTML, the slides HTML, and the ending HTML. It is easy to wrap the slides inside the main HTML for the slide show page. For each slide, the HTML for the given content will be generated and not anything extra. This is important for creating a slide show from markdown. It doesn’t try to create a full page of properly formatted HTML with a header and body sections. The kramdown program only translates the markdown given to valid HTML. There will now be a test.html file with the this content: This is a header As an example, put the following markdown in to a file called test.md: # This is a header Once installed, the kramdown command is usable. To install k ramdown, open a Terminal and type: Since Ruby is pre-installed on all Macs, installing kramdown is easy. Kramdown is a Ruby program that takes text in one format and translates it in to another. The best renderer I have used is kramdown. Markdown to HTMLĪ rendering program is a program that takes the markdown and translates it to another format. In this tutorial, I’ll show you how to create a HTML slide show from markdown notes. You need an effective and easy way to create your presentation from your notes. Now comes the moment you need to make a presentation based on your notes. It gives a way to format without cluttering up what is being written. Markdown text formatting has revolutionized note taking.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |