Skip to content

Commit

Permalink
Format code blocks in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed May 24, 2021
1 parent 811fb19 commit 6c952eb
Show file tree
Hide file tree
Showing 10 changed files with 1,014 additions and 545 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ Manage your dotfiles across multiple diverse machines, securely.
With chezmoi, you can install chezmoi and your dotfiles on a new, empty machine
with a single command:

sh -c "$(curl -fsLS git.io/chezmoi)" -- init --apply <github-username>
```console
$ sh -c "$(curl -fsLS git.io/chezmoi)" -- init --apply <github-username>
```

Updating your dotfiles on any machine is a single command:

chezmoi update
```console
$ chezmoi update
```

* [How do I start with chezmoi now?](#how-do-i-start-with-chezmoi-now)
* [What does chezmoi do and why should I use it?](#what-does-chezmoi-do-and-why-should-i-use-it)
Expand Down
8 changes: 6 additions & 2 deletions chezmoi.io/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ Manage your dotfiles across multiple diverse machines, securely.
With chezmoi, you can install chezmoi and your dotfiles on a new, empty machine
with a single command:

sh -c "$(curl -fsLS git.io/chezmoi)" -- init --apply <github-username>
```console
$ sh -c "$(curl -fsLS git.io/chezmoi)" -- init --apply <github-username>
```

Updating your dotfiles on any machine is a single command:

chezmoi update
```console
$ chezmoi update
```

## How do I start with chezmoi now?

Expand Down
8 changes: 6 additions & 2 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ interested in contributing to chezmoi.
You can generate Go documentation for chezmoi's source code with `go doc`, for
example:

go doc -all -u github.com/twpayne/chezmoi/v2/internal/chezmoi
```console
$ go doc -all -u github.com/twpayne/chezmoi/v2/internal/chezmoi
```

You can also [browse chezmoi's generated documentation
online](https://pkg.go.dev/github.com/twpayne/chezmoi/v2) but this only includes
Expand Down Expand Up @@ -170,7 +172,9 @@ framework. End-to-end tests use
with the test scripts themselves in `testdata/scripts`. You can run individual
end-to-end tests with

go test . -run=TestScript/<name>
```console
$ go test . -run=TestScript/<name>
```

where `<name>` is the basename of file in `testdata/scripts`.

Expand Down
59 changes: 43 additions & 16 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,36 @@ chezmoi requires Go 1.16 or later.
chezmoi is a standard Go project, using standard Go tooling, with a few extra
tools. Ensure that these extra tools are installed with:

make ensure-tools
```console
$ make ensure-tools
```

Build chezmoi:

go build .
```console
$ go build .
```

Run all tests:

go test ./...
```console
$ go test ./...
```

Run chezmoi:

go run .
```console
$ go run .
```

## Generated code

chezmoi generates shell completions, the install script, and the website from a
single source of truth. You must run

make generate
```console
$ make generate
```

if you change includes any of the following:

Expand Down Expand Up @@ -104,12 +114,15 @@ Releases are managed with [`goreleaser`](https://goreleaser.com/).

To build a test release, without publishing, (Linux only) run:

make test-release

```console
$ make test-release
```
Publish a new release by creating and pushing a tag, e.g.:

git tag v1.2.3
git push --tags
```console
$ git tag v1.2.3
$ git push --tags
```

This triggers a [GitHub Action](https://github.com/twpayne/chezmoi/actions) that
builds and publishes archives, packages, and snaps, and creates a new [GitHub
Expand All @@ -120,11 +133,15 @@ Publishing [Snaps](https://snapcraft.io/) requires a `SNAPCRAFT_LOGIN`
secret](https://github.com/twpayne/chezmoi/settings/secrets/actions). Snapcraft
logins periodically expire. Create a new snapcraft login by running:

snapcraft export-login --snaps=chezmoi --channels=stable --acls=package_upload -
```console
$ snapcraft export-login --snaps=chezmoi --channels=stable --acls=package_upload -
```

[brew](https://brew.sh/) formula must be updated manually with the command:

brew bump-formula-pr --tag=v1.2.3 chezmoi
```console
$ brew bump-formula-pr --tag=v1.2.3 chezmoi
```

## Packaging

Expand Down Expand Up @@ -181,25 +198,35 @@ branch](https://github.com/twpayne/chezmoi/tree/gh-pages) to GitHub.
Before building the website, you must download the [Hugo Book
Theme](https://github.com/alex-shpak/hugo-book) by running:

git submodule update --init
```console
$ git submodule update --init
```

Test the website locally by running:

( cd chezmoi.io && hugo serve )
```console
$ ( cd chezmoi.io && hugo serve )
```

and visit http://localhost:1313/.

To build the website in a temporary directory, run:

( cd chezmoi.io && make )
```console
$ ( cd chezmoi.io && make )
```

From here you can run

git show
```console
$ git show
```

to show changes and

git push
```console
$ git push
```

to push them. You can only push changes if you have write permissions to the
chezmoi GitHub repo.
20 changes: 15 additions & 5 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@

Run:

chezmoi doctor
```console
$ chezmoi doctor
```

Anything `ok` is fine, anything `warning` is only a problem if you want to use
the related feature, and anything `error` indicates a definite problem.
Expand Down Expand Up @@ -104,7 +106,9 @@ that files and directories are group writeable by default.
You can override this for chezmoi by setting the `umask` configuration variable
in your configuration file, for example:

umask = 0o022
```toml
umask = 0o022
```

Note that this will apply to all files and directories that chezmoi manages and
will ensure that none of them are group writeable. It is not currently possible
Expand Down Expand Up @@ -266,12 +270,16 @@ The `gpg.recipient` key should be ultimately trusted, otherwise encryption will
fail because gpg will prompt for input, which chezmoi does not handle. You can
check the trust level by running:

gpg --export-ownertrust
```console
$ gpg --export-ownertrust
```

The trust level for the recipient's key should be `6`. If it is not, you can
change the trust level by running:

gpg --edit-key $recipient
```console
$ gpg --edit-key $recipient
```

Enter `trust` at the prompt and chose `5 = I trust ultimately`.

Expand Down Expand Up @@ -308,7 +316,9 @@ lock include `diff`, `status`, and `verify`.

chezmoi requires Go version 1.16 or later. You can check the version of Go with:

go version
```console
$ go version
```

For more details on building chezmoi, see the [Contributing
Guide]([CONTRIBUTING.md](https://github.com/twpayne/chezmoi/blob/master/docs/CONTRIBUTING.md)).
Expand Down

0 comments on commit 6c952eb

Please sign in to comment.