generate markdown documents from source code comments
Switch branches/tags
Nothing to show
Clone or download
Latest commit aae560f Apr 21, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/leri sasdoc -> leri Jan 31, 2017
lib implemented basic md creation for go and sas Feb 1, 2017
vendor/github.com/urfave/cli init (copied a lot of stuff from asami) Jan 30, 2017
.gitignore Initial commit Jan 30, 2017
LICENSE Initial commit Jan 30, 2017
README.md fixed md link Feb 1, 2017
goreleaser.yml Update goreleaser.yml Apr 21, 2017
lock.json update lock.json Jan 31, 2017
manifest.json init (copied a lot of stuff from asami) Jan 30, 2017

README.md

leri

Powered By: GoReleaser

a small (and currently quite limited) command line tool to generate markdown files from source code comments

why?

I used leri mainly to generate some tutorial-like documents from heavily documented source code.

features

leri currently only supports .go and .sas files, but could be extended easily by defining own regular expressions to match comments that should be interpreted as documentation, (see: lib/parsing/parser.go and parser usage in file lib/commands/genmd.go).

installation

go get github.com/blblblu/leri/cmd/leri

(or download a pre-compiled version from the releases page)

usage example

Let's assume you have a file lorem.go with following content:

package ecs

import "github.com/blblblu/reba/env"

// Initer is used for Systems or Entities that want to initialized based on the env.Context before the main loop
type Initer interface {
	Init(ctx *env.Context)
}

// Updater is used for Systems that want to be involved in the main loop
type Updater interface {
	Update(ctx *env.Context)
}

// Cleanuper is used for Systems that want to free resources (like e.g. deleting OpenGL buffers etc.)
type Cleanuper interface {
	Cleanup(ctx *env.Context)
}

When running leri gen -i lorem.go -o lorem.md, leri will recognize each // comment that starts at the beginning of the line as documentation, and will create the following lorem.md file:

```go
package ecs

import "github.com/blblblu/reba/env"

```

Initer is used for Systems or Entities that want to initialized based on the env.Context before the main loop

```go
type Initer interface {
  Init(ctx *env.Context)
}

```

Updater is used for Systems that want to be involved in the main loop

```go
type Updater interface {
  Update(ctx *env.Context)
}

```

Cleanuper is used for Systems that want to free resources (like e.g. deleting OpenGL buffers etc.)

```go
type Cleanuper interface {
  Cleanup(ctx *env.Context)
}

```

which will look as follows:


package ecs

import "github.com/blblblu/reba/env"

Initer is used for Systems or Entities that want to initialized based on the env.Context before the main loop

type Initer interface {
  Init(ctx *env.Context)
}

Updater is used for Systems that want to be involved in the main loop

type Updater interface {
  Update(ctx *env.Context)
}

Cleanuper is used for Systems that want to free resources (like e.g. deleting OpenGL buffers etc.)

type Cleanuper interface {
  Cleanup(ctx *env.Context)
}