README: update to reflect changes for Go 1, cleanup

This commit is contained in:
Michael Teichgräber 2012-04-21 01:44:22 +02:00
parent fc11ba4282
commit 99ba8c18fe

View File

@ -22,74 +22,59 @@ concatenating ten [Markdown syntax descriptions][syntax].
[syntax]: http://daringfireball.net/projects/markdown/syntax.text [syntax]: http://daringfireball.net/projects/markdown/syntax.text
In [December 2010][dec], the `8g` compiled Go version still was The C version is still around 1.9x faster than the Go version.
around 3.5 times slower than the original C version.
[dec]: https://github.com/knieriem/markdown/commit/b3f7b3
In the meantime Go compilers and runtime have been improved,
which reduced the factor down to around 2.5 for both `8g` and `6g`
for the unmodified sources.
After some current changes to the peg/leg parser generator
the Markdown parser can take advantage of the *switch* optimization
now. This further reduced the execution time difference
to 1.9x for `6/8g`.
## Installation ## Installation
Provided you have a recent copy of Go, and git is available, Provided you have a copy of Go 1, and git is available,
goinstall github.com/knieriem/markdown go get github.com/knieriem/markdown
should install the package into should download and install the package according to
`$GOROOT/src/pkg/github.com/knieriem/markdown`, and build your GOPATH settings.
it.
See doc.go for an example how to use the package. See doc.go for an example how to use the package.
To create the command line program *markdown,* run To create the command line program *markdown,* run
cd $GOROOT/src/pkg/github.com/knieriem/markdown go build github.com/knieriem/markdown/cmd/markdown
gomake cmd
the binary should then be available in subdirectory *cmd.* the binary should then be available in the current directory.
To run the Markdown 1.0.3 test suite, type To run the Markdown 1.0.3 test suite, type
make mdtest make test
This will download peg-markdown, in case you have `git` This will download peg-markdown, in case you have Mercurial
available, build cmd/markdown, and run the test suite. and the hg-git extension available, build cmd/markdown, and
run the test suite.
The test suite will fail on one test, for the same reason which The test suite should fail on exactly one test
*Ordered and unordered lists* , for the same reason which
applies to peg-markdown, because the grammar is the same. applies to peg-markdown, because the grammar is the same.
See the [original README][] for details. See the [original README][] for details.
[original README]: https://github.com/jgm/peg-markdown/blob/master/README.markdown [original README]: https://github.com/jgm/peg-markdown/blob/master/README.markdown
## Development ## Development
[`Goinstall`][Goinstall] is creating its own Makefiles to build There is not yet a way to create a Go source file like
packages, based on the `.go` files found in the directory. `parser.leg.go` automatically from another file, `parser.leg`,
It would not know about `parser.leg.go`, which had to be built when building packages and commands using the Go tool. To make
by `leg` from the `parser.leg` grammar source file first. *markdown* installable using `go get`, `parser.leg.go` has
Because of this, to make *markdown* installable using been added to the VCS.
`goinstall`, `parser.leg.go` has been added to the VCS.
`Make` will update `parser.leg.go` using `leg`, which is part of `Make parser` will update `parser.leg.go` using `leg`, which
[knieriem/peg][] at github, if parser.leg has been changed. If is part of [knieriem/peg][] at github, if parser.leg has
a copy of this package has not yet been downloaded -- i.e. no been changed, or if the Go file is missing. If a copy of *peg*
directory `./peg` is present --, `make` will perform the is not yet present on your system, run
necessary steps automatically (run `make peg` to manually
download [knieriem/peg][]).
To update [knieriem/peg][] run `gomake update-peg`. This will go get github.com/knieriem/peg
fetch available revisions from github, and remove the old
*leg* binary. Then `make parser` should succeed.
[goinstall]: http://golang.org/cmd/goinstall/
[knieriem/peg]: https://github.com/knieriem/peg [knieriem/peg]: https://github.com/knieriem/peg
@ -115,8 +100,6 @@ As definition item markers both `:` and `~` can be used.
* Implement tables * Implement tables
* Rename element key identifiers, so that they are not public
* Where appropriate, use more idiomatic Go code * Where appropriate, use more idiomatic Go code
## Subdirectory Index ## Subdirectory Index