66 Commits

Author SHA1 Message Date
Eli Bendersky
2570a9c136 Remove old Ruby-based upload script
The new Go-based code works fine and has successfully uploaded the site
several times now. This removes a dependency on a non-Go flow which
should make development easier.
2021-09-08 05:49:47 -07:00
Eli Bendersky
b4568f3025 Refactor page footer to separate template
Fixes #387
2021-09-02 10:26:17 -07:00
Eli Bendersky
68cc690ca4 Add a wrapper script for tools/upload.go
The script sets up the -region and -bucket flags to point to the right S3
location. AWS_* env vars should still be set manually.

The old Ruby uploading code is moved to upload-ruby-old for now (will be
deleted later)
2021-09-02 06:42:17 -07:00
Eli Bendersky
198349f683 Add comments and clean up code 2021-09-02 06:40:02 -07:00
Eli Bendersky
364c664211 Initial version of the Go uploader to S3
It works using a test bucket
2021-09-02 06:19:19 -07:00
Eli Bendersky
ac94809b64
Replace deprecated ioutil functions with others (#374)
* Remove use of deprecated ioutil functions from examples

* Remove usage of ioutil from gobyexample's own scripts

+ regenerate output
2021-08-28 06:38:35 -07:00
Blake Bourque
58e66a8103
Use chroma (#346)
Use Chroma for syntax highlighting and remove vendor'd Pygments
2021-02-27 06:30:00 -08:00
Eli Bendersky
81ab859a7b
Upgrade blackfriday to v2 and fix underscore italics (#350)
Now that we have a go.mod, we can properly upgrade to blackfriday/v2

The output remains the same, but this PR brings back italic links with '_',
placing them into the link since this seems to be the more proper way.

Fixes #182
2021-02-20 10:22:23 -08:00
Hana
9e216da9ef go.mod: add go.mod and move pygments to third_party
After go1.16, go will use module mode by default,
even when the repository is checked out under GOPATH
or in a one-off directory. Add go.mod, go.sum to keep
this repo buildable without opting out of the module
mode.

> go mod init github.com/mmcgrana/gobyexample
> go mod tidy
> go mod vendor

In module mode, the 'vendor' directory is special
and its contents will be actively maintained by the
go command. pygments aren't the dependency the go will
know about, so it will delete the contents from vendor
directory. Move it to `third_party` directory now.

And, vendor the blackfriday package.

Note: the tutorial contents are not affected by the
change in go1.16 because all the examples in this
tutorial ask users to run the go command with the
explicit list of files to be compiled (e.g.
`go run hello-world.go` or `go build command-line-arguments.go`).
When the source list is provided, the go command does
not have to compute the build list and whether it's
running in GOPATH mode or module mode becomes irrelevant.
2021-02-15 16:45:26 -05:00
andrew
5f6871027f Add error check to generate go 2020-03-09 12:35:41 +02:00
Oleg Butuzov
646c8b39da bugfix (mmcgrana/gobyexample#294) sha1 sum calculator
This bugfix implements correct way to calculate source sha1 hash, before it will changed,
by propagation of unchanged sources.

This commit will also include regenerated static files and *.hash files.
2019-10-22 14:27:02 +03:00
Mark McGranaghan
78e1fd61ec Clean up merge 2019-09-01 16:09:36 -07:00
Mark McGranaghan
ee5c86daa9 Merge branch 'master' into clipboard 2019-09-01 15:42:08 -07:00
Shivam Rathore
1943fe0803 arrow keys navigation added | fixes mmcgrana/gobyexample#222 2019-07-08 19:04:14 -07:00
Eli Bendersky
fb2c28e58a When testing on Travis, verify that tools/build was run
This is done by routing the generation of HTML into a temporary directory,
and checking its diff agains the existing public/ when running tests.

Fixes #237
2019-07-01 06:44:09 -07:00
Mark McGranaghan
bee52f22ce Change word 2019-06-08 11:21:40 -04:00
Eli Bendersky
70cb6ffb45 Add printout when sending a request to play.golang.org 2019-06-07 06:26:27 -07:00
Eli Bendersky
cb0f0a3056 Tweak logged text 2019-06-07 06:17:26 -07:00
Eli Bendersky
cdbdae9715 Do progress reporting during parsing/processing stage, not HTML render stage 2019-06-07 06:12:30 -07:00
Eli Bendersky
d34c7ac64e Rewrite verbose() to work in OSX bash 2019-06-06 05:26:20 -07:00
Eli Bendersky
3d0bde4f8f Add verbose guard in parseExamples 2019-06-05 10:17:09 -07:00
Eli Bendersky
5487e88919 Add VERBOSE option to tools/build and generate.go
VERBOSE will be set by TRAVIS (but can also be set by user to diagnose slow
builds). Using an env var so that it automatically propagates to all the
sub-scripts and tools without having to pass it through tools/build explicitly.
2019-06-05 10:15:13 -07:00
Eli Bendersky
7c160440be Use tabs as the canonical source indentation in git
Space conversion is done during generation only. Fixes #192
2019-06-04 07:30:58 -07:00
Mark McGranaghan
4ab97fb99b
Merge pull request #226 from eliben/sanitytest
Adding a basic sanity testing tool to run during 'build'.
2019-05-30 12:50:03 -07:00
Mark McGranaghan
95e26aa537 Shorter name 2019-05-30 07:42:36 -07:00
Eli Bendersky
8930aa53f3 Adding a basic sanity testing tool to run during 'build'.
The tool just runs 'go vet' for now; could do more later (like actually
run the examples and compare to some expected output)
2019-05-30 06:05:58 -07:00
Eli Bendersky
9e31d5eb10 Remove old comment 2019-05-29 13:49:42 -07:00
Eli Bendersky
f3f319ccce Rewrite the local server in Go 2019-05-29 13:46:05 -07:00
Mark McGranaghan
c43c319d26 Add local serve script 2019-03-20 11:30:56 -07:00
Mark McGranaghan
0a96c21881 Allows tools to use Go-standard formatting 2018-02-01 17:07:33 -05:00
Mark McGranaghan
451160492a Check for template errors 2018-02-01 16:09:53 -05:00
Noah Zoschke
08b8a98248 remove unreachable code (go vet) 2018-01-26 08:52:01 -08:00
Noah Zoschke
d5a7560cdc Url should be URL (golint) 2018-01-26 08:51:01 -08:00
Noah Zoschke
13a5dea6a7 Id should be ID (golint) 2018-01-26 08:48:48 -08:00
Noah Zoschke
116b4c7341 exported types should have comment (golint) 2018-01-26 08:46:33 -08:00
julien
dc33273d8a added clipboard functionality with your comments 2017-01-03 17:50:49 +01:00
Mark McGranaghan
a334236cc3 Remove todos
We are not planning to address them at this point.
2016-12-27 12:54:04 -08:00
Mark McGranaghan
fd5e6d9ef6 Handle empty spans generated by newer Pygments 2016-12-27 08:28:35 -08:00
Mark McGranaghan
fa2299285e Merge pull request #105 from rafmagana/per-platform-sed-command-to-format-to-4-spaces
Per platform 'sed' command to format files to have 4 spaces (darwin and linux supported)
2016-12-27 07:16:05 -08:00
Mark McGranaghan
5fa2fcc49b Use https for play.golang.org, now required 2016-06-05 14:28:32 -07:00
Mark McGranaghan
7ce10fd6f1 Add in our Ruby script 2016-01-02 17:35:05 -08:00
Rafael Magana
d99a6a9c5e Per platform 'sed' command to format files to have 4 spaces (darwin and linux supported) 2015-04-16 14:06:22 -05:00
Joel Scoble
8e7a6bb086 Update format script for new gofmt
gofmt no longer supports `tabs` and `tabwidth`, but we still require
exactly-4-space tabs to preserve the narrow layout on gobyexample.com,
so re-implement this functionality with sed.
2014-12-13 14:19:07 -08:00
everyx
d244c2cbe4 add missing utf-8 package import 2014-02-23 15:42:54 +08:00
everyx
bfa6fa1771 fix measure for ckj character 2014-02-22 22:38:15 +08:00
Mark McGranaghan
49870a9701 place gopher run link in top-right of rendered go source 2013-10-06 09:25:48 -07:00
Mark McGranaghan
afdf0cc2b4 add trailing newlines 2013-10-06 08:50:23 -07:00
Mark McGranaghan
b0b6dbeb1b switch to if 2013-10-06 08:47:52 -07:00
Mark McGranaghan
37028a7f0f simplify parseHashFile 2013-10-06 08:45:36 -07:00
Mark McGranaghan
d61579313a just panic here for now 2013-10-06 08:42:34 -07:00