Skip to content

Commit

Permalink
readme, license, tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcgrana committed Sep 30, 2012
1 parent 8d6e33f commit 9443213
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
18 changes: 18 additions & 0 deletions LICENSE
@@ -0,0 +1,18 @@
Copyright (c) 2012 Mark McGranaghan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 changes: 29 additions & 0 deletions README.md
@@ -1,2 +1,31 @@
## golit

**golit** generates literate-programming-style HTML documentation
from a Go source file. It produces HTML with comments alongside your
code.

See the [golit-generated docs](http://mmcgrana.github.com/golit/) for
more information.


### Installation

```console
$ go get github.com/mmcgrana/golit
```

### Usage

```console
$ golit input.go > output.html
```


### Hacking

```console
$ cd golit
$ vi ...
$ go get
$ golit ...
```
8 changes: 7 additions & 1 deletion main.go
Expand Up @@ -23,10 +23,14 @@ import (
"strings"
)

// `golit` takes exactly one argument: the path to a Go source file.
// ### Usage

// golit takes exactly one argument: the path to a Go source file.
// It writes the compiled HTML on stdout.
var usage = "usage: golit input.go > output.html"

// ### Helpers

// Panic on non-nil errors. We'll call this after error-returning
// functions.
func check(err error) {
Expand All @@ -51,6 +55,8 @@ func pipe(bin string, arg []string, src string) string {
return string(bytes)
}

// ### Rendering

// Recognize doc lines, extract their comment prefixes.
var docsPat = regexp.MustCompile("^\\s*\\/\\/\\s")

Expand Down

0 comments on commit 9443213

Please sign in to comment.