Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix broken links in docs #787

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ module.exports = {
}
```

See the [toolbox api docs](./docs/toolbox-api.md) for more details on what you can do.
See the [toolbox api docs](/toolbox-api) for more details on what you can do.

See the [runtime docs](./docs/runtime.md) for more details on building your own CLI and join us in the #gluegun channel of the Infinite Red Community Slack ([community.infinite.red](http://community.infinite.red)) to get friendly help!
See the [runtime docs](/runtime) for more details on building your own CLI and join us in the #gluegun channel of the Infinite Red Community Slack ([community.infinite.red](http://community.infinite.red)) to get friendly help!

# Who Is Using This?

Expand Down
8 changes: 4 additions & 4 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = {
description: 'Displays the name of an actor',
hidden: false,
dashed: false,
run: async toolbox => {
run: async (toolbox) => {
const { print } = toolbox

print.info(`Tom Hanks`)
Expand All @@ -49,7 +49,7 @@ The `name` and `description` properties are used in `printCommands` calls to pri

`dashed` lets you run the command as a dashed command, like `--version` or `-v`.

The `run` property should be a function (async or not) that does whatever you want it to. You'll receive the gluegun `toolbox` object which contains the [core extensions](./toolbox-api.md) and any additional extensions you've loaded.
The `run` property should be a function (async or not) that does whatever you want it to. You'll receive the gluegun `toolbox` object which contains the [core extensions](/toolbox-api) and any additional extensions you've loaded.

## templates

Expand All @@ -61,7 +61,7 @@ Extensions are additional functionality that you can monkeypatch onto the `toolb

```js
// extensions/sayhello.js
module.exports = toolbox => {
module.exports = (toolbox) => {
const { print } = toolbox

toolbox.sayhello = () => {
Expand All @@ -74,7 +74,7 @@ When you have this extension, you can access it in any command file, like this:

```js
// ...
run: async toolbox => {
run: async (toolbox) => {
const { sayhello } = toolbox

sayhello()
Expand Down
19 changes: 7 additions & 12 deletions docs/runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const cli = build('movie')
.help()
.version()
.defaultCommand()
.command({ name: 'hi', run: toolbox => toolbox.print.info('hi!') })
.command({ name: 'hi', run: (toolbox) => toolbox.print.info('hi!') })
.exclude(['filesystem', 'semver', 'system', 'prompt', 'http'])
.checkForUpdates(5) // check for updates randomly about 5% of the time
.create()
Expand Down Expand Up @@ -65,7 +65,7 @@ $ movie producers "Planes, Trains, & Automobiles" --sort age

## plugin

Additional functionality can be added to the `gluegun` object with [plugins](./plugins.md). Plugins can be yours or your users.
Additional functionality can be added to the `gluegun` object with [plugins](/plugins/). Plugins can be yours or your users.

_Hint: `src` and `plugin` are almost identical under the hood. The only thing they do differently is `src` will be loaded first and be the "default plugin"._

Expand All @@ -86,20 +86,15 @@ movie-credits
You can load a plugin from a directory:

```js
const cli = build('movie')
.src(__dirname)
.plugin('~/.movie/movie-imdb')
const cli = build('movie').src(__dirname).plugin('~/.movie/movie-imdb')
```

## plugins

You can also load multiple plugins within a directory.

```js
const cli = build('movie')
.src(__dirname)
.plugin('~/.movie/movie-imdb')
.plugins('./node_modules', { pattern: 'movie-' })
const cli = build('movie').src(__dirname).plugin('~/.movie/movie-imdb').plugins('./node_modules', { pattern: 'movie-' })
```

`plugins` supports a `fs-jetpack` [matching pattern](https://github.com/szwacz/fs-jetpack#findpath-searchoptions) so you can filter out a subset of directories instead of just all.
Expand Down Expand Up @@ -189,7 +184,7 @@ const cli = build('movie')
.help()
.version()
.defaultCommand()
.command({ name: 'hi', run: toolbox => toolbox.print.info('hi!') })
.command({ name: 'hi', run: (toolbox) => toolbox.print.info('hi!') })
```

In this case, if you ran `movie hi`, it would run the function provided and print out 'hi!'.
Expand Down Expand Up @@ -266,7 +261,7 @@ const cli = build('movie')
.help()
.version()
.defaultCommand()
.command({ name: 'hi', run: toolbox => toolbox.print.info('hi!') })
.command({ name: 'hi', run: (toolbox) => toolbox.print.info('hi!') })
.checkForUpdates(5)
```

Expand All @@ -282,7 +277,7 @@ const cli = build('movie')
.help()
.version()
.defaultCommand()
.command({ name: 'hi', run: toolbox => toolbox.print.info('hi!') })
.command({ name: 'hi', run: (toolbox) => toolbox.print.info('hi!') })
.checkForUpdates(5)
.create()
```
Expand Down