<commit_before># Text Invoice

Some tools and helpers for creating, summarising and transforming invoices stored as [YAML][yaml] documents.

The tools are designed to be used in a UNIX-like environment.

## Typical uses

Create a new invoice

    text-invoice new > some-job.yaml

Update totals, transform to HTML and write to disk

    cat some-job.yaml | text-invoice update | text-invoice html > some-job.html

Get a summary of all invoices 
    
    find -name "*.yaml" | xargs text-invoice summary

Get a summarised list of all invoices 
    
    find -name "*.yaml" | xargs text-invoice list

Get a summarised list of all invoices which contain a word

    grep -r -l "some pattern" * | xargs text-invoice list

You get the idea.

## Installing

    gem install text-invoice

## Custom templates

It's just YAML so it's easy template. I use [Mustache templates][mustache] for the default HTML invoice, and added an option to support custom Mustache templates

    cat some-job.yml | text-invoice template my-template.mustache > some-job.something

Of course if you have the Mustache gem installed (which is a dependency of this gem!) you can just use that!
<commit_msg>Made note of the samples in the example folder in the readme<commit_after># Text Invoice

Some tools and helpers for creating, summarising and transforming invoices stored as [YAML][yaml] documents.

The tools are designed to be used in a UNIX-like environment.

## Typical uses

Create a new invoice

    text-invoice new > some-job.yaml

Update totals, transform to HTML and write to disk

    cat some-job.yaml | text-invoice update | text-invoice html > some-job.html

Get a summary of all invoices 
    
    find -name "*.yaml" | xargs text-invoice summary

Get a summarised list of all invoices 
    
    find -name "*.yaml" | xargs text-invoice list

Get a summarised list of all invoices which contain a word

    grep -r -l "some pattern" * | xargs text-invoice list

You get the idea.

## Installing

    gem install text-invoice

## Samples Invoice

Yo, added examples of the YAML, template and a PDF. They're in the example directory.

## Custom templates

It's just YAML so it's easy template. I use [Mustache templates][mustache] for the default HTML invoice, and added an option to support custom Mustache templates

    cat some-job.yml | text-invoice template my-template.mustache > some-job.something

Of course if you have the Mustache gem installed (which is a dependency of this gem!) you can just use that!

{'fraction_non_alphanumeric': 0.06349840255591055, 'fraction_numerical': 0.0, 'mean_word_length': 3.5053956834532376, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7670287', 'n_tokens_mistral': 747, 'n_tokens_neox': 698, 'n_words': 346}