homepage: https://git.sr.ht/~rycee/svgsym
changelog-type: markdown
hash: b032e7ed9ba921261fa7e1697f5f34bc16ad6d89b9c1c365b2ee20a1e09c6616
test-bench-deps: {}
maintainer: robert@rycee.net
synopsis: A tool to prune unused symbols from icon SVG files.
changelog: |
  # Revision history for svgsym

  ## 0.1.0.0 -- YYYY-mm-dd

  * First version. Released on an unsuspecting world.
basic-deps:
  bytestring: ^>=0.10
  base: ^>=4.15.1
  filepath: ^>=1.4
  xml: ^>=1.3
  containers: ^>=0.6
  regex-tdfa: ^>=1.3.1
  optparse-applicative: ^>=0.16
  filepattern: ^>=0.1.2
  directory: ^>=1.3
all-versions:
- 0.1.0.0
author: Robert Helgesson
latest: 0.1.0.0
description-type: markdown
description: |
  # svgsym

  This is a simple tool to prune unused symbols from icon SVG files.

  Specifically, this tools takes as input

  - an SVG file that consists only of `symbol` elements,

  - one of more glob patterns of source files, and

  - a regular expression that identifies symbol references.

  It then scans your source files for references to symbols in the SVG
  file. The output of the tool is an SVG file that contains only the
  symbols referenced in your source files.

  ## Example

  We can prune the `all.svg` file from [css.gg](https://css.gg/) project
  for a Haskell project by running the below command. Note that the
  symbol regular expression consist of a single capture group that
  captures the actual symbol identifier.

  ``` sh-session
  $ svgsym css-gg/all.svg \
      --content './src/**/*.hs' \
      --symbol '"(gg-[a-z]+)"' \
      > ./output/static/css-gg.svg
  ```

  ## Bug Reports and Sending Patches

  Bug reports and patches are managed through my [sourcehut public inbox][].

  [sourcehut public inbox]: https://lists.sr.ht/~rycee/public-inbox

  ## Development

  The intended development flow is to use a Nix Flake development shell,
  e.g., using [Direnv](https://direnv.net/) or directly running

  ``` console
  $ nix develop .
  …
  ```

  This will help set up a shell containing the necessary development
  dependencies. This shell will also be populated with utilities that
  can be run directly in the terminal:

  - `p-format` – formats the project's Cabal, Haskell, and Nix code.

  ## License

  [GNU General Public License v3.0 or later](https://spdx.org/licenses/GPL-3.0-or-later.html)
license-name: GPL-3.0-or-later

Update from Hackage at 2022-05-01T08:09:56Z
Update from Hackage at 2022-05-01T08:09:56Z
