Module: Polites

Defined in:
lib/polites.rb,
lib/polites/cli.rb,
lib/polites/tag.rb,
lib/polites/file.rb,
lib/polites/node.rb,
lib/polites/span.rb,
lib/polites/text.rb,
lib/polites/block.rb,
lib/polites/nanoc.rb,
lib/polites/plist.rb,
lib/polites/sheet.rb,
lib/polites/markup.rb,
lib/polites/parser.rb,
lib/polites/convert.rb,
lib/polites/version.rb,
lib/polites/settings.rb,
lib/polites/range_tag.rb,
lib/polites/span/code.rb,
lib/polites/span/emph.rb,
lib/polites/span/link.rb,
lib/polites/span/mark.rb,
lib/polites/block/list.rb,
lib/polites/simple_tag.rb,
lib/polites/span/image.rb,
lib/polites/span/delete.rb,
lib/polites/span/strong.rb,
lib/polites/code_grouper.rb,
lib/polites/block/divider.rb,
lib/polites/block/heading.rb,
lib/polites/list_indenter.rb,
lib/polites/span/footnote.rb,
lib/polites/block/heading1.rb,
lib/polites/block/heading2.rb,
lib/polites/block/heading3.rb,
lib/polites/block/heading4.rb,
lib/polites/block/heading5.rb,
lib/polites/block/heading6.rb,
lib/polites/html_formatter.rb,
lib/polites/block/paragraph.rb,
lib/polites/span/annotation.rb,
lib/polites/block/blockquote.rb,
lib/polites/block/code_block.rb,
lib/polites/nanoc/data_source.rb,
lib/polites/block/ordered_list.rb,
lib/polites/block/unordered_list.rb,
lib/polites/nanoc/extract_file_filter.rb,
lib/polites/nanoc/embedded_images_filter.rb

Overview

Polites allows you to work with files generated by the Ulysses writing application for macos.

Most importantly, this gem allows you to take Ulysses .ulyz files as input and transform them into HTML, all from Ruby. Additionally, you can extract embedded media files from the .ulyz file.

Examples:

Transform a file to HTML

Polites::Convert.new.call('/path/to/file.ulyz')
# => (html content)

Parse a sheet

Polites::File.open('/path/to/file.ulyz') do |f|
  sheet = Polites::Parser.new.parse_sheet(f.content)
  sheet.keywords # => ['Keyword1', 'Keyword2']
  sheet.files # => ['1a3577ba004942ecb71d8a940cab4b1f']
  Polites::HtmlFormatter.new.call(sheet)
  # => (html content)
end

Defined Under Namespace

Modules: Nanoc Classes: Block, Cli, CodeGrouper, Convert, Error, File, FormattingError, HtmlFormatter, ListIndenter, Markup, Node, ParseError, Parser, Plist, RangeTag, Settings, Sheet, SimpleTag, Span, Tag, Text

Constant Summary collapse

VERSION =
'0.3.0'