Skip to content

Commit

Permalink
Updated documentation and cli usage text
Browse files Browse the repository at this point in the history
  • Loading branch information
slaskis committed Sep 13, 2016
1 parent 4cb8e70 commit d5a571a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ Options:
- `codeIndent` - a string of whitespace to be used for indentation
- `compressed` - whether the output should have its whitespace stripped

#### `svgsus.svgsymbol.convert(svg, options={})`

Generates a SVG symbol in a "Spritesheet". It can then easily be used in HTML
documents using svg `<use />`-tags.

Options:

- `name` - the id of the symbol in the sheet
- `stripStyle` - whether to remove any style tags from the SVG so it's stylable using CSS.
- `codeIndent` - a string of whitespace to be used for indentation
- `compressed` - whether the output should have its whitespace stripped

#### `svgsus.css.convert(svg, options={})`

Generates CSS class with a background using the SVG as a data-uri.
Expand Down
4 changes: 3 additions & 1 deletion test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ test('bin/svgsus jade < fixtures/coin.original.svg', t => run(t))
test('bin/svgsus pug < fixtures/coin.original.svg', t => run(t))
test('bin/svgsus svg < fixtures/coin.original.svg', t => run(t))
test('bin/svgsus uibezierpath < fixtures/coin.original.svg', t => run(t))
test('bin/svgsus vectordrawable < fixtures/coin.original.svg', t => run(t))
test('bin/svgsus uibezierpath < fixtures/coin.original.svg', t => run(t))
test('bin/svgsus svgsymbol --stripStyle < fixtures/coin.original.svg', t => run(t))
test('bin/svgsus svgsymbol --invalidOption < fixtures/coin.original.svg', t => run(t).catch(io => t.falsy(io.stout) && t.regex(io.stderr, /Usage: /)))
test('bin/svgsus missing < fixtures/coin.original.svg', t => run(t).catch(io => t.falsy(io.stout) && t.regex(io.stderr, /not a valid format/)))
test('bin/svgsus pug fixtures/coin.original.svg', t => run(t).then(cleanup('coin.original.pug')))
test('bin/svgsus pug fixtures/coin.original.svg fixtures/logo-defs.original.svg', t => run(t).then(cleanup('coin.original.pug', 'logo-defs.original.pug')))
Expand Down
6 changes: 5 additions & 1 deletion usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Svgsus - Organize, clean and transform your SVGs
Usage: svgsus <format> [options] [--] [<file>...]

svgsus svg [--codeIndent=<indent> --compressed --output=<dir>] [--] [<file>...]
svgsus svgsymbol [--codeIndent=<indent> --stripStyle --name=<name> --compressed --output=<dir>] [--] [<file>...]
svgsus css [--codeIndent=<indent> --output=<dir>] [--] [<file>...]
svgsus (pug|jade) [--codeIndent=<indent> --output=<dir>] [--] [<file>...]
svgsus cashapelayer [--codeIndent=<indent> --codeType=<type> --output=<dir>] [--] [<file>...]
Expand All @@ -12,7 +13,10 @@ Svgsus - Organize, clean and transform your SVGs
svgsus --version

Options:
--compressed wether the output should have whitespace stripped
--stripStyle whether to remove any style tags from the SVG so it's
stylable using CSS.
--name=<name> the id of the symbol in the sheet [default: svg-symbol]
--compressed whether the output should have whitespace stripped
--codeIndent=<indent> must be whitespace [default: " "]
--codeType=<type> must be either "AppKit" or "UIKit" [default: UIKit]
--output=<dir> a directory to write converted files to, defaults to
Expand Down

0 comments on commit d5a571a

Please sign in to comment.