See testdata/README for test format.
This will make it easier to fix problems and not regress.
Markdown tests in followup CL (with bug fixes).
Change-Id: I5dedca26d3c29fd428066ffb38c6605343784a19
Reviewed-on: https://go-review.googlesource.com/c/tools/+/224957
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Commands like .code now have a TemplateCmd method
that returns the original command.
The Text struct now has a Raw field set when Pre==true.
It contains the original indented text, without the tab "fixing".
This helps building tooling that reformats or rewrites present files.
For golang/go#33955.
Change-Id: Ieb036e8b509a4531d120c597b19f2158306a5352
Reviewed-on: https://go-review.googlesource.com/c/tools/+/222845
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Found with honnef.co/go/tools/cmd/unused.
Change-Id: Iabfa1e9926e097ba11d1db0a2d785fec70ce3997
Reviewed-on: https://go-review.googlesource.com/37609
Reviewed-by: Alan Donovan <adonovan@google.com>
Also added a suite of tests and fixed a minor bug that
caused a panic when the .code command specified HL with
no text after.
Fixesgolang/go#17379.
Change-Id: I3c246523c3d4010bf76a467ee648475255090e1b
Reviewed-on: https://go-review.googlesource.com/30691
Reviewed-by: Rob Pike <r@golang.org>
For /start/,/end/, the /end/ address can wrap around and match somewhere
before /start/. Handle this case without crashing.
Fixesgolang/go#7163.
Change-Id: I6fc3b5048e88728c9403a1d1e284ea8ada567a1e
Reviewed-on: https://go-review.googlesource.com/21182
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
This will be used to show the "Run" button for code snippets in go.talks only for Go when running on App Engine.
R=adg, r, iant
CC=golang-dev
https://golang.org/cl/21930047
Also update style.css to hide outline of editable text areas and apply
correct styles to line numbers in non-playground snippets.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13946043
Godoc depends on go.talks/pkg/present by way of go.tools/pkg/blog.
Better to keep all godoc dependencies in one place.
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/13656047