Skip to content

Commit

Permalink
docs: added anchor tags for settings (#2845)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx authored Oct 27, 2024
1 parent c70eb16 commit 01adaa5
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 55 deletions.
4 changes: 2 additions & 2 deletions docs/cli/alias/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ The alias to show

Examples:

$ mise alias get node lts-hydrogen
20.0.0
$ mise alias get node lts-hydrogen
20.0.0
8 changes: 4 additions & 4 deletions docs/cli/reshim.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ If you think mise should automatically call this for a particular command, pleas
open an issue on the mise repo. You can also setup a shell function to reshim
automatically (it's really fast so you don't need to worry about overhead):

npm() {
command npm "$@"
mise reshim
}
npm() {
command npm "$@"
mise reshim
}

Note that this creates shims for _all_ installed tools, not just the ones that are
currently active in mise.toml.
Expand Down
15 changes: 11 additions & 4 deletions docs/components/setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ defineProps(["setting", "level"]);
</script>

<template>
<h2 v-if="level === 2">
<code>{{ setting.key }}</code>
<h2 v-if="level === 2" :id="setting.key">
<code>{{ setting.key }}</code
><a :href="`#${setting.key}`" class="header-anchor"></a>
<span v-if="setting.deprecated" class="VPBadge warning">deprecated</span>
</h2>
<h3 v-if="level === 3">
<code>{{ setting.key }}</code>
<h3 v-if="level === 3" :id="setting.key">
<code>{{ setting.key }}</code
><a :href="`#${setting.key}`" class="header-anchor"></a>
<span v-if="setting.deprecated" class="VPBadge warning">deprecated</span>
</h3>
<h4 v-if="level === 4" :id="setting.key">
<code>{{ setting.key }}</code
><a :href="`#${setting.key}`" class="header-anchor"></a>
<span v-if="setting.deprecated" class="VPBadge warning">deprecated</span>
</h4>

<ul>
<li>
Expand Down
40 changes: 40 additions & 0 deletions docs/components/settings.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<script setup>
import { data } from "/settings.data.ts";
import Setting from "/components/setting.vue";
const { child } = defineProps(["child", "level"]);
const settings = child ? data.find((f) => f.key === child).settings : data;
</script>

<!-- <ul>-->
<!-- <li v-for="setting in settings">-->
<!-- <a v-if="!settings.settings" :href="`#${ setting.key }`"><code>{{ setting.key }}</code></a>-->
<!-- <ul v-if="setting.settings">-->
<!-- <li v-for="child in setting.settings">-->
<!-- <a :href="`#${ child.key }`"><code>{{ child.key }}</code></a>-->
<!-- </li>-->
<!-- </ul>-->
<!-- </li>-->
<!-- </ul>-->

<template>
<Setting
v-for="setting in settings.filter((f) => f.type)"
:setting="setting"
:key="setting.key"
:level="level"
/>

<div v-for="child in settings.filter((f) => !f.type)">
<h2 :id="child.key">
<code>{{ child.key }}</code>
<a :href="`#${child.key}`" class="header-anchor"></a>
</h2>
<Setting
v-for="setting in child.settings"
:setting="setting"
:key="setting.key"
:level="level + 1"
/>
</div>
</template>
10 changes: 2 additions & 8 deletions docs/configuration/settings.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# Settings

<script setup>
import { data } from '/settings.data.ts';
import Setting from '/components/setting.vue';
import Settings from '/components/settings.vue';
</script>

The following is a list of all of mise's settings. These can be set via `mise settings set`,
by directly modifying `~/.config/mise/config.toml` or local config, or via environment variables.

Some of them also can be set via global CLI flags.

<Setting v-for="setting in data.filter(f => f.type)" :setting="setting" :key="setting.key" :level="2" />

<div v-for="child in data.filter(f => !f.type)">
<h2><code>{{ child.key }}</code></h2>
<Setting v-for="setting in child.settings" :setting="setting" :key="setting.key" :level="3" />
</div>
<Settings :level="2" />
6 changes: 2 additions & 4 deletions docs/dev-tools/backends/cargo.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,9 @@ This will execute a `cargo install` command with the corresponding Git options.
Set these with `mise settings set [VARIABLE] [VALUE]` or by setting the environment variable listed.

<script setup>
import { data } from '/settings.data.ts';
import Setting from '/components/setting.vue';
const settings = data.find(s => s.key === 'cargo').settings;
import Settings from '/components/settings.vue';
</script>
<Setting v-for="setting in settings" :setting="setting" :key="setting.key" :level="3" />
<Settings child="cargo" :level="3" />

## Tool Options

Expand Down
6 changes: 2 additions & 4 deletions docs/dev-tools/backends/pipx.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ Other syntax may work but is unsupported and untested.
Set these with `mise settings set [VARIABLE] [VALUE]` or by setting the environment variable listed.

<script setup>
import { data } from '/settings.data.ts';
import Setting from '/components/setting.vue';
const settings = data.find(s => s.key === 'pipx').settings;
import Settings from '/components/settings.vue';
</script>
<Setting v-for="setting in settings" :setting="setting" :key="setting.key" :level="3" />
<Settings child="pipx" :level="3" />

## Tool Options

Expand Down
2 changes: 1 addition & 1 deletion docs/environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ _.file = '.env'

_This uses [dotenvy](https://crates.io/crates/dotenvy) under the hood. If you have problems with
the way `env._.file` works, you will likely need to post an issue there,
not to mise since there is not much mise can do about the way that crate works._
not to mise since there is not much mise can do about the way that crate works.\_

Or set [`MISE_ENV_FILE=.env`](/configuration#mise-env-file) to automatically load dotenv files in any
directory.
Expand Down
6 changes: 2 additions & 4 deletions docs/lang/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ required system dependencies.
## Settings

<script setup>
import { data } from '/settings.data.ts';
import Setting from '/components/setting.vue';
const settings = data.find(s => s.key === 'node').settings;
import Settings from '/components/settings.vue';
</script>
<Setting v-for="setting in settings" :setting="setting" :key="setting.key" :level="3" />
<Settings child="node" :level="3" />

### Environment Variables

Expand Down
8 changes: 2 additions & 6 deletions docs/lang/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,9 @@ additional to that python in mise has a few extra configuration variables.
Set these with `mise settings set [VARIABLE] [VALUE]` or by setting the environment variable.

<script setup>
import { data } from '/settings.data.ts';
import Setting from '/components/setting.vue';

const settings = data.find(s => s.key === 'python').settings;
import Settings from '/components/settings.vue';
</script>

<Setting v-for="setting in settings" :setting="setting" :key="setting.key" :level="3" />
<Settings child="python" :level="3" />

## Default Python packages

Expand Down
8 changes: 2 additions & 6 deletions docs/lang/ruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ for additional settings and some troubleshooting.
in additional to that mise has a few extra settings:

<script setup>
import { data } from '/settings.data.ts';
import Setting from '/components/setting.vue';

const settings = data.find(s => s.key === 'ruby').settings;
import Settings from '/components/settings.vue';
</script>

<Setting v-for="setting in settings" :setting="setting" :key="setting.key" :level="3" />
<Settings child="ruby" :level="3" />

## Default gems

Expand Down
12 changes: 6 additions & 6 deletions mise.usage.kdl
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ cmd "alias" help="Manage aliases" {
This is the contents of an alias.<PLUGIN> entry in ~/.config/mise/config.toml"
after_long_help r"Examples:

$ mise alias get node lts-hydrogen
20.0.0
$ mise alias get node lts-hydrogen
20.0.0
"
arg "<PLUGIN>" help="The plugin to show the alias for"
arg "<ALIAS>" help="The alias to show"
Expand Down Expand Up @@ -855,10 +855,10 @@ If you think mise should automatically call this for a particular command, pleas
open an issue on the mise repo. You can also setup a shell function to reshim
automatically (it's really fast so you don't need to worry about overhead):

npm() {
command npm "$@"
mise reshim
}
npm() {
command npm "$@"
mise reshim
}

Note that this creates shims for _all_ installed tools, not just the ones that are
currently active in mise.toml."#
Expand Down
4 changes: 2 additions & 2 deletions src/cli/alias/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ impl AliasGet {
static AFTER_LONG_HELP: &str = color_print::cstr!(
r#"<bold><underline>Examples:</underline></bold>
$ <bold>mise alias get node lts-hydrogen</bold>
20.0.0
$ <bold>mise alias get node lts-hydrogen</bold>
20.0.0
"#
);

Expand Down
8 changes: 4 additions & 4 deletions src/cli/reshim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ use crate::toolset::ToolsetBuilder;
/// open an issue on the mise repo. You can also setup a shell function to reshim
/// automatically (it's really fast so you don't need to worry about overhead):
///
/// npm() {
/// command npm "$@"
/// mise reshim
/// }
/// npm() {
/// command npm "$@"
/// mise reshim
/// }
///
/// Note that this creates shims for _all_ installed tools, not just the ones that are
/// currently active in mise.toml.
Expand Down

0 comments on commit 01adaa5

Please sign in to comment.