Skip to content

Commit 2fcde33

Browse files
jthegedusStratus3D
authored andcommitted
Documentation site (asdf-vm#422)
* init docsify * add config & plugins to support required features * create cover page * add sidebar headings * add novel 404 page * add translation message to 404 * add navbar with translations dropdown * fix punctuation * add all-plugins section pulling from asdf-plugins repo readme * update sidebar with sections, better names & descriptions for contributors * add changelog. pulls from repo * add thanks page. credits, maintainers & link to contributors on github * add core documentation * rm old readme from docs/ folder this was copied here on docsify init * comment out some translation config ideally this will remain commented out serving as an example for any translation contributions * run prettier over markdown * add plugins-create section * add contributing sections to the docs * fix cover page get-started link * use the readme as the main homepage * update asdf version in docs with release script
1 parent 06c1e66 commit 2fcde33

17 files changed

Lines changed: 597 additions & 40 deletions

‎docs/.nojekyll‎

Whitespace-only changes.

‎docs/_404.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<h2 align="center">404</h2>
2+
3+
<p align="center">
4+
Woops! It seems we're lost! :sweat_smile:
5+
<br />
6+
Let's <a href="/">go home</a> and try again.
7+
<br />
8+
If we end up lost again, <a href="https://github.com/asdf-vm/asdf/issues/new">yell out for some help</a> :mega:
9+
</p>
10+
11+
<p align="center">
12+
If you are here because of a missing section or translation, please <a href="/#/contributing">think of contributing</a> :two_hearts:
13+
</p>

‎docs/_coverpage.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- ![logo](_media.asdf-vm-logo.svg) -->
2+
3+
# asdf vm
4+
5+
> An extendable version manager
6+
7+
- Bash, Zsh, Fish
8+
- Node.js, Ruby, Python, Elixir ... and more
9+
- Simple plugin system
10+
11+
[GitHub](https://github.com/asdf-vm/asdf)
12+
[Get Started](core-manage-asdf-vm)

‎docs/_navbar.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Translations
2+
- [:uk: English](/)

‎docs/_sidebar.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- docs/_sidebar.md -->
2+
3+
- [Home](/) <!-- ballad of asdf here -->
4+
5+
- Core
6+
7+
- [Manage asdf-vm](core-manage-asdf-vm)
8+
- [Manage Plugins](core-manage-plugins)
9+
- [Manage Versions](core-manage-versions)
10+
- [Configuration](core-configuration) <!-- tool-versions & .asdfrc & env vars-->
11+
- [All Commands](core-commands) <!-- include uninstall instructions -->
12+
13+
- Plugins
14+
15+
- [Creating Plugins](plugins-create)
16+
- [All Plugins](plugins-all) <!-- pulls in asdf-vm/asdf-plugins readme -->
17+
18+
- Contributing
19+
20+
- [Core asdf vm](contributing-core-asdf-vm)
21+
- [Documentation Site](contributing-doc-site)
22+
23+
- [Changelog](changelog) <!-- pulls in changelog from repo -->
24+
- [Thanks](thanks) <!-- credits, maintainers, contributors -->

‎docs/contributing-core-asdf-vm.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Development
2+
3+
To develop the project, simply `git clone` the master branch.
4+
5+
If you want to try out your changes without making change to your installed `asdf`, you can set the `$ASDF_DIR` variable to the path where you cloned the repository, and temporarily prepend the `bin` and `shims` directory of the directory to your path.
6+
7+
Tools we use:
8+
9+
- [bats](https://github.com/sstephenson/bats) for testing. Make sure
10+
`bats test/` passes after you made your changes.
11+
- [Shellcheck](https://github.com/koalaman/shellcheck) for static analysis of our shell scripts.
12+
13+
## Docker Images
14+
15+
The [asdf-alpine][asdf-alpine] and [asdf-ubuntu][asdf-ubuntu] projects are an
16+
ongoing effort to provide Dockerized images of some asdf tools. You can use
17+
these docker images as base for your development servers, or for running your
18+
production apps.
19+
20+
[asdf-alpine]: https://github.com/vic/asdf-alpine
21+
[asdf-ubuntu]: https://github.com/vic/asdf-ubuntu

‎docs/contributing-doc-site.md‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
## Setup Your Environment
2+
3+
We're using:
4+
5+
- [Node.js](https://github.com/asdf-vm/asdf-nodejs) `v10.15.0` to support the other required tools
6+
- [docsify](https://docsify.js.org/#/) to create our documentation site
7+
- [prettier](https://prettier.io/) to format our markdown files
8+
9+
### Install Dependencies
10+
11+
We are trying to **avoid polluting** the core repo with tooling for this documentation site. As such, it would be great if you could install these development tools **globally** so we don't need to commit them to this project.
12+
13+
```shell
14+
npm i docsify-cli prettier -g
15+
```
16+
17+
## Serve the Site
18+
19+
From the root of this repo run:
20+
21+
```shell
22+
docsify serve docs
23+
```
24+
25+
## Format before Committing
26+
27+
From the root of this repo run:
28+
29+
```shell
30+
prettier --write "docs/**/*.md"
31+
```
32+
33+
## Translations
34+
35+
It would be great to provide translations for other languages.
36+
37+
Docsify makes adding new languages quite easy. Look in `docs/index.html` for commented out `zh-cn` examples.
38+
39+
### Adding a new Translation
40+
41+
1. create a folder in `docs/` for the new translation
42+
```
43+
docs/
44+
docs/zh-cn/
45+
```
46+
2. copy file from root `docs/_404.md` to new folder `docs/zh-cn/_404.md`
47+
```
48+
docs/_404.md
49+
docs/zh-cn/_404.md
50+
```
51+
3. replace text with translated text.
52+
4. repeat for all files.
53+
5. add a link to the new translation in `_navbar.md`.
54+
6. run `prettier` before committing.
55+
56+
For more information, see the [Configuration](https://docsify.js.org/#/configuration) docsify docs, the [Custom navbar](https://docsify.js.org/#/custom-navbar) docsify docs, and have a look at their own `index.html`'s [search section](https://github.com/docsifyjs/docsify/blob/6ac7bace213145cb655e9a5e9e209384db08e5f9/docs/index.html#L48).

‎docs/core-commands.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Manage Plugins
2+
3+
| Command | Effect |
4+
| ------------------------------------ | ------------------------------------------------------------ |
5+
| `asdf plugin-add <name> [<git-url>]` | Add a plugin from the plugin repo OR, add a Git repo |
6+
| | ...as a plugin by specifying the name and repo url |
7+
| `asdf plugin-list` | List installed plugins |
8+
| `asdf plugin-list --urls` | List installed plugins with repository URLs |
9+
| `asdf plugin-list-all` | List plugins registered on asdf-plugins repository with URLs |
10+
| `asdf plugin-remove <name>` | Remove plugin and package versions |
11+
| `asdf plugin-update <name>` | Update plugin |
12+
| `asdf plugin-update --all` | Update all plugins |
13+
14+
## Manage Packages
15+
16+
| Command | Effect |
17+
| --------------------------------- | --------------------------------------------------------------------- |
18+
| `asdf install [<name> <version>]` | Install a specific version of a package, or with no arguments, |
19+
| | ...install all the package versions listed in the .tool-versions file |
20+
| `asdf uninstall <name> <version>` | Remove a specific version of a package |
21+
| `asdf current` | Display current version set or being used for all packages |
22+
| `asdf current <name>` | Display current version set or being used for package |
23+
| `asdf where <name> [<version>]` | Display install path for an installed or current version |
24+
| `asdf which <name>` | Display install path for current version |
25+
| `asdf local <name> <version>` | Set the package local version |
26+
| `asdf global <name> <version>` | Set the package global version |
27+
| `asdf list <name>` | List installed versions of a package |
28+
| `asdf list-all <name>` | List all versions of a package |
29+
30+
## Utils
31+
32+
| Command | Effect |
33+
| ------------------------------ | ---------------------------------------------- |
34+
| `asdf reshim <name> <version>` | Recreate shims for version of a package |
35+
| `asdf update` | Update asdf to the latest stable release |
36+
| `asdf update --head` | Update asdf to the latest on the master branch |

‎docs/core-configuration.md‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## .tool-versions
2+
3+
Whenever `.tool-versions` file is present in a directory, the tool versions it declares will be used in that directory and any subdirectories. **Global defaults can be set in the file `$HOME/.tool-versions`**
4+
5+
This is what a `.tool-versions` file looks like:
6+
7+
```
8+
ruby 2.5.3
9+
nodejs 10.15.0
10+
```
11+
12+
The versions can be in the following format:
13+
14+
- `10.15.0` - an actual version. Plugins that support downloading binaries, will download binaries.
15+
- `ref:v1.0.2-a` or `ref:39cb398vb39` - tag/commit/branch to download from github and compile
16+
- `path:/src/elixir` - a path to custom compiled version of a tool to use. For use by language developers and such.
17+
- `system` - this keyword causes asdf to passthrough to the version of the tool on the system that is not managed by asdf.
18+
19+
To install all the tools defined in a `.tool-versions` file run `asdf install` with no other arguments in the directory containing the `.tool-versions` file.
20+
21+
Edit the file directly or use `asdf local` (or `asdf global`) which updates it.
22+
23+
## \$HOME/.asdfrc
24+
25+
Add a `.asdfrc` file to your home directory and asdf will use the settings specified in the file. The file should be formatted like this:
26+
27+
```
28+
legacy_version_file = yes
29+
```
30+
31+
**Settings**
32+
33+
- `legacy_version_file` - defaults to `no`. If set to yes it will cause plugins that support this feature to read the version files used by other version managers (e.g. `.ruby-version` in the case of Ruby's `rbenv`).
34+
35+
## Environment Variables
36+
37+
- `ASDF_CONFIG_FILE` - Defaults to `~/.asdfrc` as described above. Can be set to any location.
38+
- `ASDF_DEFAULT_TOOL_VERSIONS_FILENAME` - The name of the file storing the tool names and versions. Defaults to `.tool-versions`. Can be any valid file name.
39+
- `ASDF_DATA_DIR` - Defaults to `~/.asdf` - Location where `asdf` install plugins, shims and installs. Can be set to any location before sourcing `asdf.sh` or `asdf.fish` mentioned in the section above.

‎docs/core-manage-asdf-vm.md‎

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
## Install asdf-vm
2+
3+
Clone only the latest branch:
4+
5+
```shell
6+
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.6.2
7+
```
8+
9+
Alternately, you can clone the whole repo and checkout the latest branch:
10+
11+
```shell
12+
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
13+
cd ~/.asdf
14+
git checkout "$(git describe --abbrev=0 --tags)"
15+
```
16+
17+
### Add to your Shell
18+
19+
<!-- tabs:start -->
20+
21+
#### ** Bash on Linux **
22+
23+
```bash
24+
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
25+
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
26+
```
27+
28+
#### ** Bash on macOS **
29+
30+
```bash
31+
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bash_profile
32+
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bash_profile
33+
```
34+
35+
#### ** ZSH **
36+
37+
If you are using a framework, such as oh-my-zsh, use these lines. (Be sure
38+
that if you make future changes to .zshrc these lines remain _below_ the line
39+
where you source your framework.)
40+
41+
```shell
42+
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
43+
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
44+
```
45+
46+
If you are not using a framework, or if on starting your shell you get an
47+
error message like 'command not found: compinit', then add this line before
48+
the ones above.
49+
50+
```shell
51+
autoload -Uz compinit && compinit
52+
```
53+
54+
#### ** Fish **
55+
56+
```shell
57+
echo 'source ~/.asdf/asdf.fish' >> ~/.config/fish/config.fish
58+
mkdir -p ~/.config/fish/completions; and cp ~/.asdf/completions/asdf.fish ~/.config/fish/completions
59+
```
60+
61+
<!-- tabs:end -->
62+
63+
Restart your shell so that PATH changes take effect. (Opening a new terminal
64+
tab will usually do it.)
65+
66+
### Having Issues?
67+
68+
If you're having issues with it not detecting the shims you've installed it's most-likely due to the sourcing of above `asdf.bash` or `asdf.fish` not being at the **BOTTOM** of your `~/.bash_profile`, `~/.zshrc`, or `~/.config/fish/config.fish`. It needs to be sourced **AFTER** you have set your `$PATH.`
69+
70+
### Plugin Dependencies
71+
72+
For most plugins, it is good if you have installed the following packages OR their equivalent on your OS
73+
74+
<!-- tabs:start -->
75+
76+
#### ** macOS **
77+
78+
Install these via homebrew:
79+
80+
```shell
81+
coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc
82+
```
83+
84+
#### ** Ubuntu **
85+
86+
```shell
87+
automake autoconf libreadline-dev libncurses-dev libssl-dev libyaml-dev libxslt-dev libffi-dev libtool unixodbc-dev
88+
```
89+
90+
#### **Fedora**
91+
92+
```shell
93+
automake autoconf readline-devel ncurses-devel openssl-devel libyaml-devel libxslt-devel libffi-devel libtool unixODBC-devel
94+
```
95+
96+
<!-- tabs:end -->
97+
98+
**That's all ~! You are ready to use asdf**
99+
100+
## Update
101+
102+
```shell
103+
asdf update
104+
```
105+
106+
If you want the latest changes that aren't yet included in a stable release:
107+
108+
```shell
109+
asdf update --head
110+
```
111+
112+
## Remove
113+
114+
1. In your `.bashrc` (or `.bash_profile` if you are on OSX) or `.zshrc` find the lines that source `asdf.sh` and the autocompletions. The lines should look something like this:
115+
116+
. $HOME/.asdf/asdf.sh
117+
. $HOME/.asdf/completions/asdf.bash
118+
119+
Remove these lines and save the file.
120+
121+
2. Run `rm -rf ~/.asdf/` to completely remove all the asdf files from your system.
122+
123+
That's it!

0 commit comments

Comments
 (0)