Giter Site home page Giter Site logo

rebecca's Introduction

Rebecca

Rebecca is a readme generator.

Managing the GitHub readme for your Go project can be a drag. When creating jennifer I found examples copied into the markdown would get out of date, and documentation was duplicated. I created rebecca to solve this: see README.md.tpl in the jennifer repo for a real world example.

Install

go get -u github.com/dave/rebecca/cmd/becca

Usage

becca [-package={your-package}]

Rebecca will read README.md.tpl and overwrite README.md with the rendered template. The package specified on the command line is parsed (if no package is specified, it is detected from the current working directory).

The package is scanned for examples and documentation. Rebecca uses the Go template library, and adds some custom template functions:

Example

{{ "ExampleFoo" | example }}

This prints the code and expected output for the ExampleFoo example.

Doc

{{ "Foo" | doc }}

This prints the documentation for Foo. All package level declarations are supported (func, var, const etc.)

{{ "Foo.Bar" | doc }}

This prints the documentation for the Bar member of the Foo type. Methods and struct fields are supported.

You can also specify which sentances to print, using Go slice notation:

{{ "Foo[i]" | doc }}
{{ "Foo[i:j]" | doc }}
{{ "Foo[i:]" | doc }}
{{ "Foo[:i]" | doc }}

See here and here for real-world examples of this.

Code, Output

{{ "ExampleFoo" | code }}

This prints just the code for the ExampleFoo example.

{{ "ExampleFoo" | output }}

This prints just the expected output for the ExampleFoo example.

rebecca's People

Contributors

dave avatar dim avatar

Watchers

 avatar  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.