Skip to content

Commit

Permalink
docs: improve documents
Browse files Browse the repository at this point in the history
  • Loading branch information
adoyle-h committed Dec 3, 2022
1 parent c7d50c5 commit a4a60b9
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 deletions.
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ An elegant framework to manage commands, completions, dotfiles for terminal play

- Manage collections of dotfiles in one place. Using YAML file to manage soft-links via [dotbot][].
- Manage shell scripts, completions, aliases by [modules](#modules). Support custom modules.
- Easy to share and reuse executable files, sub commands, configs and modules by [repo](#onerepos). Read [one.share][]. And suspport custom repo.
- Easy to share and reuse executable files, sub commands, configs and modules by [repo](#onerepos). Read [one.share][].
- Support custom repo and multiple repos. Managed by [`ONE_REPOS`](#onerepos).
- Manage commands under scope. Like `a <cmd>` to invoke command that no worry about duplicated in `PATH`. Read the [ONE_SUB Commands](./docs/advanced-usage/one-sub-cmd.md).
- Support custom one.bash. Read [ONE_CONF](#oneconf).
- Support [bash-it][]. You can use one.bash commands to manage bash-it's aliases/completions/plugins. Read [./docs/advanced-usage/bash-it.md](./docs/advanced-usage/bash-it.md).
- Support [Fig][]. Read [./docs/advanced-usage/fig.md](./docs/advanced-usage/fig.md).
- Support [bash-it][]. You can use one.bash commands to manage bash-it's aliases/completions/plugins. Read [bash-it.md](./docs/advanced-usage/bash-it.md).
- Support [Fig][]. Read [fig.md](./docs/advanced-usage/fig.md).

## Environments

Expand Down Expand Up @@ -101,11 +102,18 @@ EOF

For more `ONE_CONF` options and documents, Please read [./one.config.default.bash][one.config.default].

You can use `one config <key>=<val>` set config option. (ONE_LINKS_CONF not supported)

And `one config <key>` to query config option.

### ONE_LINKS_CONF

`ONE_LINKS_CONF` is a bash function that returns a filepath of [dotbot][] config.

[dotbot][] is used to manage symbol links of dotfiles (or any files). You can use the [dotfiles from one.share][one.share] or your own dotfiles.
It receives a parameter that is current OS. So you can manage different ONE_LINKS_CONF for different OS (such as MacOS, Linux).

[dotbot][] is used to manage symbol links of dotfiles (or any files).
You can use the [dotfiles from one.share][one.share] or from your own dotfiles.

The default `ONE_LINKS_CONF` return empty. User should defined yours in ONE_CONF file.

Expand Down Expand Up @@ -138,6 +146,10 @@ See https://github.com/anishathalye/dotbot/wiki/Plugins

## Usage

If `ONE_SHARE_ENABLE` is true, invoke `$ONE_SHARE_ENABLE/recommended-modules` to enable recommended modules in one.share.

If `ONE_BASH_IT_ENABLE` is true, invoke `one completion enable aliases.completion`.

## ONE Commands

The `one` command is used to manage one.bash modules, one.config, and dependencies.
Expand Down Expand Up @@ -166,8 +178,6 @@ It provides many commands defined in [./one-cmds/](./one-cmds).
- `one help -a` to list all usages of commands.
- `one bin list` to show all executable files in `bin/` of each repo.
- `one sub list` to show all commands in `sub/` of each repo.
- `one config <key>=<val>` and `one config <key>` to set and query config option.
- `one debug true|false` to enable/disable debug mode

## Modules

Expand Down Expand Up @@ -227,7 +237,7 @@ Read [this document](./docs/advanced-usage/one-sub-cmd.md) for more details.

- [Bashrc Initialization Proces](./docs/entry.md)
- [Project File Structure](./docs/file-structure.md)
- [Advanced Usages](./docs/advanced-usage)
- [Advanced Usages](./docs/advanced-usage/README.md)
- [ONE Dependencies](./docs/advanced-usage/dep.md)
- [ONE Functions](./docs/advanced-usage/one-functions.md)
- [ONE_SUB Command](./docs/advanced-usage/one-sub-cmd.md)
Expand Down
8 changes: 8 additions & 0 deletions docs/advanced-usage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@ Invoke `one debug false` will turn off debug logs.

one.bash will reset `PATH` environment variable.
You can manage `PATH` by `ONE_PATHS` in your ONE_CONF.

## More

- [ONE Dependencies](./dep.md)
- [ONE Functions](./one-functions.md)
- [ONE_SUB Command](./one-sub-cmd.md)
- [Fig](./fig.md)
- [Bash-it](./bash-it.md)
11 changes: 8 additions & 3 deletions docs/advanced-usage/bash-it.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

You can use one.bash commands to manage bash-it's aliases/completions/plugins.

one.bash enable [bash-it][] by default.
You can disable it by `ONE_BASH_IT_ENABLE=false` in `ONE_CONF`.
## Notice

Read the [default ONE_CONF](../../one.config.default.bash) for more options (`ONE_BASH_IT_`) descriptions.
1. The one.bash enable [bash-it][] by default. You can disable it by `ONE_BASH_IT_ENABLE=false` in `ONE_CONF`.
2. Read the [default ONE_CONF](../../one.config.default.bash) for more options (`ONE_BASH_IT_`) descriptions.
3. Set Bash-it configuration in your `ONE_CONF`.
4. Do not use [bash-it](https://bash-it.readthedocs.io/en/latest/commands/) commands.
4. Enable bash-it aliases/completions/plugins with `one` commands. For example, enable aliases.completion by `one completion enable aliases.completion`.

<!-- links -->

[bash-it]: https://github.com/Bash-it/bash-it
6 changes: 4 additions & 2 deletions docs/entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ It will execute scripts in order:
- Set XDG environment variables: [bash/xdg.bash](../bash/xdg.bash)
- If `$ONE_RC` is not empty, enter the `$ONE_RC`, and not execute below steps.
- If check_shell failed, enter the `$ONE_BASHRC_FO`, and not execute below steps.
- Load [composure](https://github.com/adoyle-h/composure.git)
- Load settings for OS.
- Enable Fig if `$ONE_FIG` is true
- Enable `one` and `$ONE_SUB` auto-completions
- Enabled modules: [enabled/*.bash](../enabled/)
- Enable `one` and `$ONE_SUB` auto-completions. [bash/one-complete.bash](../bash/one-complete.bash)
- Load bash-it.sh if `ONE_BASH_IT_ENABLE` is true.
- Load [enabled modules](../enabled/) if `ONE_NO_MODS` is false.

0 comments on commit a4a60b9

Please sign in to comment.