Permalink
Browse files

readme, license, tweaks

  • Loading branch information...
mmcgrana committed Sep 30, 2012
1 parent 8d6e33f commit 94432133402e46f6b86f158d9c53cfd07e394815
Showing with 54 additions and 1 deletion.
  1. +18 −0 LICENSE
  2. +29 −0 README.md
  3. +7 −1 main.go
View
18 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.
View
@@ -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 ...
+```
View
@@ -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) {
@@ -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")

0 comments on commit 9443213

Please sign in to comment.