From 4a8104737c60b4854a3b6a61076bfaddd1fe93bb Mon Sep 17 00:00:00 2001 From: Nate Finch Date: Tue, 18 Sep 2018 23:35:48 -0400 Subject: [PATCH] fix some code blocks --- site/content/blog/mage-in-ci.md | 7 ++++--- site/content/dependencies/_index.en.md | 4 ++-- site/content/index.md | 6 +++--- site/content/magefiles/_index.en.md | 4 ++-- site/content/targets/_index.en.md | 10 +++++----- site/content/zeroInstall/_index.en.md | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/site/content/blog/mage-in-ci.md b/site/content/blog/mage-in-ci.md index 0a4f0ec9..c22d5d00 100644 --- a/site/content/blog/mage-in-ci.md +++ b/site/content/blog/mage-in-ci.md @@ -20,16 +20,17 @@ mage targets in the current directory. This will download the mage source and install it (if you're using a gopath): -``` +```plain go get -d github.com/magefile/mage go run $GOPATH/src/github.com/magefile/mage/bootstrap.go install ``` If you're using go modules, you can do it with good old git clone: -``` +```plain git clone git@github.com:magefile/mage -go run ./mage/bootstrap.go install +cd mage +go run bootstrap.go install ``` Note that in the second case, the binary will be copied to where go env GOPATH diff --git a/site/content/dependencies/_index.en.md b/site/content/dependencies/_index.en.md index 9a0aef0e..93751522 100644 --- a/site/content/dependencies/_index.en.md +++ b/site/content/dependencies/_index.en.md @@ -7,7 +7,7 @@ Mage supports a makefile-style tree of dependencies using the helper library [github.com/magefile/mage/mg](https://godoc.org/github.com/magefile/mage/mg). To declare dependencies, pass any number of dependent functions of the following types: -``` +```go func() func() error func(ctx context.Context) @@ -62,7 +62,7 @@ func h() { Running `mage build` will produce the following output: -``` +```plain h running g running f running diff --git a/site/content/index.md b/site/content/index.md index 750214a3..d3ebf868 100644 --- a/site/content/index.md +++ b/site/content/index.md @@ -15,7 +15,7 @@ and above (possibly even lower versions, but they're not regularly tested). Install mage by running -``` +```plain go get -u -d github.com/magefile/mage cd $GOPATH/src/github.com/magefile/mage go run bootstrap.go @@ -50,7 +50,7 @@ import whatever libraries you want. Every library in the go ecosystem is a mage plugin. Every tool you use with Go can be used with Magefiles. ## Usage -``` +```plain mage [options] [target] Mage is a make-like command runner. See https://magefile.org for full docs. @@ -98,7 +98,7 @@ the mage execution runtime and the tasks compiled in such that it can be run on without requiring installation of dependencies. To do so, pass the output path to the compile flag. like this: -``` +```plain $ mage -compile ./static-output ``` diff --git a/site/content/magefiles/_index.en.md b/site/content/magefiles/_index.en.md index 2c3b6bee..6f908172 100644 --- a/site/content/magefiles/_index.en.md +++ b/site/content/magefiles/_index.en.md @@ -70,7 +70,7 @@ func Build(ctx context.Context) { ``` -``` +```plain $ mage -l A comment on the package will be output when you list the targets of a magefile. @@ -82,7 +82,7 @@ Targets: * default target ``` -``` +```plain $ mage -h target mage target: diff --git a/site/content/targets/_index.en.md b/site/content/targets/_index.en.md index c4264579..2184ca5e 100644 --- a/site/content/targets/_index.en.md +++ b/site/content/targets/_index.en.md @@ -3,7 +3,7 @@ title = "Targets" weight = 10 +++ A target is any exported function that is one of the following types: -``` +```go func() func() error func(context.Context) @@ -53,7 +53,7 @@ it to. Target aliases can be specified using the following notation: -``` +```go var Aliases = map[string]interface{} { "i": Install, "build": Install, @@ -71,7 +71,7 @@ normal application. To define a namespace in your magefile, simply define an exported named type of type `mg.Namespace`. Then, every method on that type which matches the normal target signature becomes a target under that namespace. -``` +```go import "github.com/magefile/mage/mg" type Build mg.Namespace @@ -88,13 +88,13 @@ func (Build) Docs() {} To call a namespaced target, type it as `namespace:target`. For example, the above would be called by typing -``` +```plain $ mage build:site ``` Similarly, the help for the target will show how it may be called: -``` +```plain $ mage -l build:docs Builds the pdf docs. diff --git a/site/content/zeroInstall/_index.en.md b/site/content/zeroInstall/_index.en.md index e389f54f..d7f60054 100644 --- a/site/content/zeroInstall/_index.en.md +++ b/site/content/zeroInstall/_index.en.md @@ -57,6 +57,6 @@ the mage execution runtime and the tasks compiled in such that it can be run on without requiring installation of dependencies. To do so, pass the output path to the compile flag. like this: -``` +```plain $ mage -compile ./static-output ```