Skip to content

Export from org-mode to a single file HTML presentation.

License

Notifications You must be signed in to change notification settings

UwUnyaa/ox-sfhp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ox-sfhp.el - export from org-mode to a single file HTML presentation

This extension allows to export from org-mode to single file HTML presentations. It works now, but it might still have some bugs.

Installation:

  1. Make sure you are using UTF-8 as your coding system.

    This extension doesn’t support other coding systems, because they could break things like pretty quotes around quote blocks.

  2. Put ox-sfhp.el somewhere in load-path.
  3. Add (require 'ox-sfhp) to your .emacs
  4. (Optional) You can byte-compile-file to make this extension run faster.

How do the presentations look like?

Output of this exporter will look like this:

These are prototype presentations written before work on this exporter started, but they look pretty much like output from it.

How the output file will look like?

  • Top level headlines will be slides
    • Other headlines will be just centered text with progressively smaller fonts (<h2> through <h6> tags)
    • Paragraphs outside of headlines are ignored

Themes:

The default theme is dark. Themes can be changed by adding following line to your org file:

#+SFHP_THEME: value

The value can be set to:

  • One of default themes:
    • light
    • dark
  • A custom theme:
    • It should be just the CSS code with that theme, without <style> tags around it.

Linking images:

Links to images will be included in output, encoded as base64 by default. They can be linked instead with relative paths using:

#+SFHP_NO_BASE64:

This will result in output that won’t display images if they aren’t provided with the file (which breaks the single file purpose of this exporter.) Linking images instead of encoding them as base64 makes exporting faster, (good for quick tests of how the output looks like, and big pictures slow down Emacs significantly) and the output is more compatible with older browsers that don’t support base64 (like (very) old versions of IE.)

Descriptions of links will be the alt text of pictures. They can be useful if the picture can’t be displayed for some reason.

The value of #+SFHP_NO_BASE64 and #+SFHP_BACKGROUND_REPEAT: can be set to anything, and they can be disabled by removing lines that define them from the org file.

Custom backgrounds:

If you want to use a picture as a background for your presentation you can use:

#+SFHP_BACKGROUND: image.jpg

image.jpg should be a path to the file you want to use as the background (preferably a relative path to it.)

If your image is small, and you want it to be repeated use:

#+SFHP_BACKGROUND_REPEAT:

Moving around the presentation:

Slides on the presentation can be changed by clicking (or touching) buttons on the bottom of the screen, or by pressing these keys:

  • left and right arrow keys
  • f, b, n, p keys
  • h, j, k, l keys

Using keys to change slides doesn’t seem to work on old versions of Internet Explorer, but clicking buttons works.

If the browser has JavaScript disabled, or it doesn’t support it, all slides will be displayed from top to bottom, and the presentation can be simply scrolled through.

Reporting bugs:

When reporting a bug, please include link to a gist with org-mode file that causes the problem. Some features of org-mode aren’t supported by this extension, so some parts of input file might be omitted.

Optional dependencies:

Extensions listed here are optional, and they aren’t required by this extension to work.

web-mode
Used to indent files. This exporter can be set to use HTML mode that comes with GNU Emacs to indent output files, but it can’t indent them properly and might break things like source blocks, so it isn’t recommended. Files aren’t indented by default if web-mode isn’t found.