<commit_before>.. image:: https://travis-ci.org/bast/gitink.svg?branch=master
   :target: https://travis-ci.org/bast/gitink/builds
.. image:: https://img.shields.io/badge/license-%20MPL--v2.0-blue.svg
   :target: ../master/LICENSE


gitink
======

ASCII to SVG Git log graph visualizer. Useful for teaching Git.

.. code:: shell

  $ cat example.txt

                       [feature]
                        |
                 x1-----x2
                /
  c1----c2----m1----c3----c4
    \        /            |
     b1----b2----b3      [master,HEAD]
     |           |
    [_branch]   [branch]

  $ virtualenv venv
  $ source venv/bin/activate
  $ pip install git+https://github.com/bast/gitink@master

  $ gitink --help
  Usage: gitink [OPTIONS]

  Options:
    --scale FLOAT             Scale sizes by this factor.
    --in-file TEXT            ASCII file to convert.
    --time-direction INTEGER  Direction of the time arrow (0, 90, 180, or 270).
    --help                    Show this message and exit.

  $ gitink --time-direction=90 --in-file=example.txt | display

This produces (display command requires
`imagemagick <https://www.imagemagick.org>`__):

.. figure:: https://github.com/bast/gitink/raw/master/img/example.jpg
   :alt: Git log graph example


Installing
----------

As the software is not quite finished it isn’t in PyPI yet. You can
install it with pip by using

.. code:: shell

  $ pip install git+https://github.com/bast/gitink@master

Alternately you can replace master with a branch or a tag.


I used this code before but the API changed?
--------------------------------------------

You can find the old version on the ``spaghetti`` branch.<commit_msg>structure doc<commit_after>.. image:: https://travis-ci.org/bast/gitink.svg?branch=master
   :target: https://travis-ci.org/bast/gitink/builds
.. image:: https://img.shields.io/badge/license-%20MPL--v2.0-blue.svg
   :target: ../master/LICENSE


gitink
======

ASCII to SVG Git log graph visualizer. Useful for teaching Git.


Example
-------

.. code:: shell

  $ cat example.txt

                       [feature]
                        |
                 x1-----x2
                /
  c1----c2----m1----c3----c4
    \        /            |
     b1----b2----b3      [master,HEAD]
     |           |
    [_branch]   [branch]

  $ gitink --time-direction=90 --in-file=example.txt | display

This produces (display command requires
`imagemagick <https://www.imagemagick.org>`__):

.. figure:: https://github.com/bast/gitink/raw/master/img/example.jpg
   :alt: Git log graph example


Available options
-----------------

.. code:: shell

  $ gitink --help
  Usage: gitink [OPTIONS]

  Options:
    --scale FLOAT             Scale sizes by this factor.
    --in-file TEXT            ASCII file to convert.
    --time-direction INTEGER  Direction of the time arrow (0, 90, 180, or 270).
    --help                    Show this message and exit.


Installation
------------

As the software is not quite finished it isn’t in PyPI yet. You can
install it with pip by using

.. code:: shell

  $ pip install git+https://github.com/bast/gitink@master

Alternately you can replace master with a branch or a tag.


I used this code before but the API changed?
--------------------------------------------

You can find the old version on the ``spaghetti`` branch.
{'fraction_non_alphanumeric': 0.1639196883428229, 'fraction_numerical': 0.014983518130056937, 'mean_word_length': 1.7655343827671914, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 13, 'lorem ipsum': 0, 'www.': 2, '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': '1712232', 'n_tokens_mistral': 1067, 'n_tokens_neox': 993, 'n_words': 298}