Git Product home page Git Product logo

adr-log's Introduction

adr-log NPM version

Generate an architectural decision log out of architectural decision records (ADRs).

Table of Contents

Install

Install with npm:

$ npm install -g adr-log

CLI

Usage: adr-log [-i] [-d <directory>] [-f <file>] [-h]

    directory:  The directory to be scanned for the *.md files
                If no <directory> is given, the current working directory will be chosen by default

    file:       The markdown file to contain the table of contents
                If no <file> file is specified, a index.md file containing the log is created in the given directory

    -i:         Edit the <file> file directly, injecting the log at <!-- adrlog -->
                Using only the -i flag, the tool will scan the current working directory for all *.md files and inject the resulting adr-log into the default index.md file
                (Without this flag, the default is to print the log to stdout.)

    -d:         Scans the given <directory> for .md files and adds them to the log which gets injected into the <file>
                (Without this flag, the current working directory will be chosen as default)

    -f:         Option to specify the <file> in which the adr-log should be injected
                (Without this flag index.md will be chosen as default.)

    -h:         Shows how to use this module

Usage

Examples

Printing the adr log to stdout

Consider a directory consisting of three files (0000-example-1.md, 0001-example-2.md, 0002-example-3.md). Execute following command:

$ adr-log -d .

This outputs following log on your console:

- [ADR-0000](0000-example-1.md) - Example 1
- [ADR-0001](0001-example-2.md) - Example 2
- [ADR-0002](0002-example-3.md) - Example 3

Generating an index.md file containing the adr log

Using -i alone (adr-log -i) generates a index.md file in the current working directory containing the log.

$ adr-log -i

Result in index.md

<!-- adrlog -->

- [ADR-0000](0000-example-1.md) - Example 1
- [ADR-0001](0001-example-2.md) - Example 2
- [ADR-0002](0002-example-3.md) - Example 3

<!-- adrlogstop -->

Since this is basically a fork of Jon Schlinkert's markdown-toc, you can also choose to insert the log into an existing file. For this to work the file must contain an opening <!-- adrlog --> code comment, after which the log will be inserted.

If the file already contains an adrlog surrounded by an opening <!-- adrlog --> and closing <!-- adrlogstop --> code comment, the existing log will be replaced.

License

Copyright © 2017, Tino Stadelmaier, Oliver Kopp, Armin Hüneburg, Tobias Wältken.

Released under the MIT License.

adr-log's People

Contributors

koppor avatar hueneburg avatar tstadelmaier avatar mee4895 avatar jonschlinkert avatar lharzenetter avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.