/dasheets

Generate cheatsheets for Dash

Primary LanguageRubyMIT LicenseMIT

Dasheets

Gem Version

Generate your own cheatsheets as docsets for Dash! Use this simple command line tool and write your cheatsheets in an easy language (Ruby DSL).

Installation

$ gem install dasheets

Usage

Write a file (here tmux.cheatsheet) containing your cheatsheet-data, e. g.:

cheatsheet do
  title 'tmux cheatsheet'
  short_name 'tmux' # Used for the filename of the docset
  introduction 'My *awesome* cheatsheet for tmux'

  # A cheatsheet must consist of categories
  category do
    id 'windows'  # must be unique and is used as title of the category

    entry do
      command 'PREFIX-c'
      name 'create window'            # A short name
      notes 'theses are some notes'   # longer explanation
    end
    entry do
      name 'rename window'
      command 'PREFIX-,'
    end
    entry do
      name 'go to next window'
      command 'PREFIX-n'
    end
  end

  category do
    id 'panes'
    entry do
      name 'split horizontally'
      command 'PREFIX-|'
      notes 'custom mapping'
    end
    entry do
      name 'split horizontally'
      command 'PREFIX-%'
    end
    entry do
      name 'split vertically'
      command 'PREFIX-"'
    end
  end

  notes 'Some notes at the end of the cheatsheet'
end

The following values may contain markdown formatted text:

  • The introduction and the notes of the cheatsheet
  • The name and the notes of the entries

For more complete examples look at some of my actual cheatsheets.

To convert this file to a docset, call

$ dasheets generate tmux.cheatsheet

Contributing

Yes, please! Open issues and pull requests on the GitHub page.

Thanks

svenwin for the awesome name!