<commit_before># ZettelOutline Rendering

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/zettel/outline/rendering`. To experiment with that code, run `bin/console` for an interactive prompt.

TODO: Delete this and the text above, and describe your gem

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'zettel-outline-rendering'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install zettel-outline-rendering

## Usage

TODO: Write usage instructions here

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/zettel-outline-rendering. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.


## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

<commit_msg>add real readme<commit_after># ZettelOutline Rendering

Assemble a first draft from your [Zettelkasten](http://zettelkasten.de) notes and an outline file. **Markdown** aware, allowing you to write arbitrarily nested lists as outlines.


## Installation

Install the ruby gem yourself from the command line:

    $ gem install zettel_outline

## Usage of the program

From the command line, run `zettel_outline` with the required parameters:

        -f, --file                   an outline file
        -a, --archive                path to your Zettel notes
        -o, --output                 file to write results to

For example:
    
    $ zettel_outline -f outline.txt -a /path/to/notes/ -o draft.txt

This will read the `outline.txt` from the current directory. It will resolve every Zettel reference using the Zettel note archive (`/path/to/notes/`) and concatenate the notes's contents into `draft.txt`.

A sample outline can look like this:

    * 201407030825 Why baking is so important for life. I really love baking
    * 201601231448 Banana cake. The very best cake ever
        * 201601222058 Nutritional value of bananas
        * 201601222035 Nutritional value of eggs

The nested list of Zettel references will be split into:

1. The Zettel ID, used to find the note in your archive; e.g. "201407030825"
2. The note title, used for the draft's output; e.g. "Why baking is so important for life"
3. The comment, which is everything after the first period in the line; e.g. "I really love baking"

Zettel note contents will be separated using Markdown-enabled HTML comments, which are surrounded with `<!--` and `-->`. So the resulting `draft.txt` will look similar to this:

    <!-- §201407030825 Why baking is so important for life -->
    <!-- I really love baking -->
    
    Baking is one of the oldest and definitely one of the 
    most delicious ways to prepare food. 
    
    ...


## Usage of the library

The higher-level interface of the gem is very simple. Wrapping every parameter into a `compile` function can look like this:

    def compile(outline_path, notes_path, draft_path)
      content = File.read(outline_path)
      result = ZettelOutline::compile(content, notes_path)
      File.open(draft_path, "w") do |f|
        f.write(ZettelOutline::render(result))
      end
    end

* `ZettelOutline::compile` takes the outline as a string and the path to resolve note references.
* `ZettelOutline::render` is just a wrapper to concatenate the result and return a simple string.


## Contributing

Bug reports and pull requests are welcome on GitHub at <https://github.com/DivineDominion/zettel-outline-rendering>. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.


## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


{'fraction_non_alphanumeric': 0.07511940946591403, 'fraction_numerical': 0.01628310898827616, 'mean_word_length': 3.58407960199005, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5945080', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1256, 'n_words': 606}