1
0
mirror of https://github.com/golang/go synced 2024-09-30 12:18:33 -06:00
Commit Graph

15 Commits

Author SHA1 Message Date
Russ Cox
e41bc02694 present: add end-to-end rendering test
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>
2020-03-23 17:17:23 +00:00
Russ Cox
657575a564 present: record info in AST for reproducing present inputs
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>
2020-03-13 20:55:18 +00:00
David R. Jenni
f9348ea9b1 x/tools/present: remove unused code
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>
2017-03-01 14:50:10 +00:00
Francesc Campoy
8453f27cc7 present: make code in slides editable only with -edit
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.

Fixes golang/go#17379.

Change-Id: I3c246523c3d4010bf76a467ee648475255090e1b
Reviewed-on: https://go-review.googlesource.com/30691
Reviewed-by: Rob Pike <r@golang.org>
2016-10-07 20:29:58 +00:00
Dominik Honnef
5ffc3249d3 present: dont crash if address searched backwards
For /start/,/end/, the /end/ address can wrap around and match somewhere
before /start/. Handle this case without crashing.

Fixes golang/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>
2016-09-13 12:21:10 +00:00
Audrey Lim
b75b3f5cd5 x/tools/present: add command line flag to enable presenter notes
Change-Id: I9d4414ce8bafcb13f53361b45774f379bacd886b
Reviewed-on: https://go-review.googlesource.com/21486
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-04-07 00:38:29 +00:00
Andrew Gerrand
fe1488f8ab present: fix misspelled TODO
Change-Id: Id984c4e5c7cde4a5ecf3ae783441fc866d86d404
Reviewed-on: https://go-review.googlesource.com/21527
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2016-04-06 00:42:05 +00:00
Robert Daniel Kortschak
6251f07ecd go.tools/present: correctly test empty argument
Updates golang/go#7613.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/105130046
2014-06-12 16:54:10 -07:00
Robert Daniel Kortschak
53915e22e2 go.tools/present: allow intentionally empty parameters
Fixes golang/go#7613.

LGTM=r
R=adg, r
CC=golang-codereviews
https://golang.org/cl/105070043
2014-06-12 15:45:26 -07:00
Francesc Campoy
246da56072 go.tools/present: Remove formatting comments (HL, OMIT) from raw code.
LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/68870043
2014-02-25 17:53:00 -08:00
Francesc Campoy
53273c1d55 go.tools: Expose filename rather than extension only, needed for new tour.
R=adg, r
CC=golang-codereviews
https://golang.org/cl/43470050
2014-01-02 16:03:56 -08:00
Francesc Campoy
6cb29d8d47 go.tools/present: add Raw content to Code for new go-tour.
R=adg
CC=golang-dev
https://golang.org/cl/26390044
2013-11-26 10:04:08 +01:00
Francesc Campoy
2c650d6a84 go.tools/present: add extension name to Code
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
2013-11-06 13:02:20 -08:00
Andrew Gerrand
88be67fd25 go.tools/present: add -edit and -numbers flags to .code/.play
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
2013-09-27 09:46:08 +10:00
Andrew Gerrand
9fc516408c go.tools/godoc/present: move present package from go.talks
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
2013-09-19 10:55:46 +10:00