Skip to content

Commit 28cbf71

Browse files
committedOct 22, 2024
docs: update doc
1 parent 7173844 commit 28cbf71

File tree

11 files changed

+56
-118
lines changed

11 files changed

+56
-118
lines changed
 

‎website/content/docs/config-import/import.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ top = false
2323
Instead of having all your configs defined in a single toml file, you can split it into multiple file :
2424

2525
```toml
26-
2726
[settings.dots]
2827
alacritty = { source = "alacritty", target = ".config/alacritty" }
2928
zsh = { source = "zsh/zshrc", target = ".zshrc" }
@@ -35,6 +34,21 @@ path = "sway/sway.toml"
3534
path = "i3/i3.toml"
3635
```
3736

37+
Alternatively you can define multiple imports at once:
38+
```toml
39+
dotfiles_dir = "dotfiles"
40+
41+
import = [
42+
{ path = "sway/sway.toml" },
43+
{ path = "i3/i3.toml" },
44+
]
45+
46+
[settings.dots]
47+
alacritty = { source = "terminals/alacritty", target = ".config/alacritty" }
48+
zsh = { source = "zsh/zshrc", target = ".zshrc" }
49+
# ...
50+
```
51+
3852
In this example we have defined our `i3` and `sway` profile in separate files :
3953

4054
```toml

‎website/content/docs/getting-started/quick-start.md

+2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ Once you are satisfied with your config, you can install your dotfiles:
9292
bombadil link
9393
```
9494

95+
Alternatively you can use `bombadil watch` to continuously render templates while editing.
96+
9597
### Clean up
9698

9799
If you want to remove symlinks generated by Toml Bombadil run the following:

‎website/content/docs/hooks/hooks.md

+10-14
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,21 @@ per profile hooks :
4141

4242
```toml
4343
[settings]
44-
prehooks = [ "echo \"Updating dots\""]
45-
posthooks = [ "echo \"Default profile\"" ]
44+
prehooks = [ "echo 'Updating dots'"]
45+
posthooks = [ "echo 'Default profile'" ]
4646

4747
[profiles.sway]
48-
prehooks = [ "echo \"Sway profile\"" ]
48+
# Use toml multiline string to escape quotes and special characters
49+
prehooks = [
50+
"""
51+
echo "Sway profile"
52+
"""
53+
]
54+
4955
posthooks = [ "sway reload" ]
5056

5157
[profiles.i3]
52-
prehooks = [ "echo \"i3 profile\"" ]
58+
prehooks = [ "echo 'i3 profile'" ]
5359
posthooks = [ "i3-msg reload" ]
5460
```
5561

@@ -61,14 +67,4 @@ posthooks = [ "i3-msg reload" ]
6167
posthooks = [ "source /home/user/.zshrc" ] # This does not work !
6268
```
6369

64-
- Environment variables won't be expanded unless you explicitly call a sub-shell :
65-
66-
```toml
67-
posthooks = [ "echo $HOME" ] # This will print "$HOME"
68-
```
69-
70-
```toml
71-
posthooks = [ "zsh -c \"echo $HOME\"" ] # This works
72-
```
73-
7470
That's it for hooks, in the next chapter we will see how to split your Bombadil config into multiple files.

‎website/content/docs/profiles-and-themes/profile-variables.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ Let's assume you have the following in your `.bashrc` dotfile:
2121
```bash
2222
# ~/bombadil-example/bashrc
2323
export JAVA_HOME={{java_home}}
24-
# ...
2524
```
2625

2726
And your default profiles variable look like this:
2827

2928
```toml
3029
# ~/bombadil-example/vars.toml
31-
java_home = "/etc/java-openjdk"
32-
# ...
30+
[java]
31+
home = "/etc/java-openjdk"
3332
```
3433

3534
Here is our bombadil config:
@@ -40,7 +39,7 @@ dotfile_dir = "bombadil-example"
4039
vars = [ "vars.toml" ]
4140

4241
[settings.dots]
43-
bashrc = { source = "bashrc", target = ".bashrc"}
42+
bashrc = { source = "bashrc", target = ".bashrc" }
4443
```
4544

4645
So far we have defined a variable for `$JAVA_HOME` and we are using it once.
@@ -57,7 +56,7 @@ dotfile_dir = "bombadil-example"
5756
vars = [ "vars.toml" ]
5857

5958
[settings.dots]
60-
bashrc = { source = "bashrc", target = ".bashrc"}
59+
bashrc = { source = "bashrc", target = ".bashrc" }
6160

6261
[profiles.corporate]
6362
vars = [ "java10-vars.toml" ]
@@ -66,8 +65,8 @@ vars = [ "java10-vars.toml" ]
6665
The profile variable file will be loaded after the default one and any matching variable name will override the default:
6766

6867
```toml
69-
java_home = "/etc/java10-openjdk"
70-
# ...
68+
[java]
69+
home = "/etc/java10-openjdk"
7170
```
7271

7372
Running `bombadil link -p corporate` would now produce the following `.bashrc` :

‎website/content/docs/profiles-and-themes/profiles-overrides.md

+2
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ Notice on the `corporate` profile we are redefining the `maven` dot entry and on
5656
Linking the default profile with `bombadil link`, will produce the following link :
5757
```bash
5858
bombadil link
59+
[Created]
5960
"/home/okno/dotfiles/.dots/maven/settings.xml" => "/home/okno/.m2/settings.xml"
6061
```
6162

6263
Linking with the `corporate` profile will use the alternate source for `.m2/settings.xml` :
6364

6465
```bash
6566
bombadil link -p corporate
67+
[Created]
6668
"/home/okno/dotfiles/.dots/maven/settings.corporate.xml" => "/home/okno/.m2/settings.xml"
6769
```
6870

‎website/content/docs/profiles-and-themes/profiles.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ top = false
1717
## Profile configuration
1818

1919
As we saw Bombadil allows to define a default profile. For some programs you might want to
20-
set an alternate configuration.
20+
set alternative configurations.
2121

2222
Bombadil allow you two do this in several ways :
2323
- override dot entries `source` and/or `target` value.
Original file line numberDiff line numberDiff line change
@@ -1,73 +0,0 @@
1-
+++
2-
title = "Variable reference"
3-
description = "Manage variable reference"
4-
date = 2021-05-16
5-
updated = 2021-05-16
6-
draft = false
7-
weight = 2
8-
sort_by = "weight"
9-
template = "docs/page.html"
10-
11-
[extra]
12-
lead = """
13-
Variable references allows using different variable names for the same values.
14-
Define system wide color schemes, global values for specific environments etc.
15-
"""
16-
toc = true
17-
top = false
18-
+++
19-
20-
### Declare variable references
21-
22-
A variable reference is declared like any other variable, except the value should be a variable name prefixed with `%`.
23-
24-
```toml
25-
a_variable = "42"
26-
variable_ref = "%a_variable"
27-
```
28-
29-
Here `%a_variable` points to `"42"`. Any template call to `{{variable_ref}}` will be replace by `42` when running
30-
`bombadil link`.
31-
32-
### Layout example
33-
34-
The main idea behind variable references is to avoid repetition and inject values into multiple dotfiles.
35-
As you will see later in this documentation, references are meant to be mixed with profiles and scoped variable.
36-
37-
For now let us define a simple layout. Assuming we are using sway as a window manager, and our terminal is alacritty,
38-
we are going to define three separate variables files :
39-
- A global variable file `theme_vars.toml`
40-
- A variable file for alacritty `alacritty_vars.toml`
41-
- A variable file for sway `sway_vars.toml`
42-
43-
```toml
44-
# bombadil.toml
45-
[settings]
46-
vars = [ "theme_vars.toml", "alacritty_vars.toml", "sway_vars.toml" ]
47-
# ...
48-
```
49-
50-
- `theme_vars.toml` contains all our system theme colors :
51-
52-
```toml
53-
red = "#ff0000"
54-
black = "#000000"
55-
green = "#008000"
56-
```
57-
- `sway_vars.toml` contain sway specific variables, some are references, some are static.
58-
```toml
59-
sway_client_focused_background = "%black"
60-
sway_client_focused_border = "#ffff00"
61-
# ...
62-
```
63-
64-
- `alacritty_vars.toml` uses references just like sway variables.
65-
66-
```toml
67-
alacritty_background = "%black"
68-
alacritty_cursor = "%green"
69-
# ...
70-
```
71-
72-
In the next section we will see how to scope variables to a specific dot entry.
73-

‎website/content/docs/template-and-variables/variable-scope.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ toc = true
1818
top = false
1919
+++
2020

21-
### Variable scopes
21+
### Variable collocation
2222

2323
By default, bombadil will look for a file named `vars.toml` in every dotfile entry source directory :
2424

@@ -44,16 +44,14 @@ wofi = { source = "wofi", target = ".config/wofi" }
4444
And some variables defined in `wofi/vars.toml` :
4545

4646
```toml
47-
# Here we use variable references from `theme.toml`
48-
bg = "%blue"
49-
input_bg = "%white"
50-
input_color = "%light_blue"
51-
input_focused_bg = "%blue"
47+
[colors]
48+
gb = "#292C3E"
49+
input_bg = "#EBEBEB"
50+
input_color = "#FF261E"
51+
input_focused_bg = "#FF261E"
5252
```
5353

54-
Running `bombadil link` will render variables defined in `wofi/vars.toml` only for templates that resides in `wofi/`.
55-
56-
### Explicitly declare scoped variables
54+
### Explicitly declare variable collocation
5755

5856
The previous example works fine as long as our dotfile source is a directory.
5957
Indeed, Bombadil will look for a variable file named `vars.toml` in the source directory and everything will be rendered

‎website/content/docs/template-and-variables/variables.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,16 @@ vars = [ "colors.toml", "env_vars.toml" ]
3535

3636
### Declare variables
3737

38-
A Bombadil var files is a toml file containing key with string values only.
38+
A Bombadil var files is a normal toml file.
3939

4040
For example, you have the following file in `{dotfiles_dir}/vars.toml`.
4141

4242
```toml
43+
[apps]
4344
terminal = "alacritty"
45+
bar = "waybar"
46+
47+
[theme.colors]
4448
background = "#292C3E"
4549
foreground = "#EBEBEB"
4650
text = "#FF261E"
@@ -51,8 +55,8 @@ green = "#A0E521"
5155
yellow = "#FFC620"
5256
blue = "#1BA6FA"
5357

54-
# A flag to conditionally include some block of configuration.
55-
set_cursor_color = "true"
58+
[theme.settings]
59+
set_cursor_color = true
5660
```
5761

5862
Given the following dot entry :
@@ -65,15 +69,14 @@ The `source` attributes point to a template dotfile named `alacritty.yaml`.
6569
We can use the previously defined variables using the `{{variable_name}}` syntax :
6670

6771
```yaml
68-
# {dotfiles}/alacritty.yml
6972
colors:
7073
primary:
71-
background: "{{background}}"
72-
foreground: "{{foreground}}"
73-
{%- if set_cursor_color == "true" %}
74+
background: "{{theme.colors.background}}"
75+
foreground: "{{theme.colors.foreground}}"
76+
{%- if theme.settings.set_cursor_color == "true" %}
7477
cursor:
75-
text: "{{text}}"
76-
cursor: "{{cursor}}"
78+
text: "{{theme.colors.text}}"
79+
cursor: "{{theme.colors.cursor}}"
7780
{% endif -%}
7881
```
7982

@@ -86,16 +89,13 @@ Templates will be rendered to the `.dots` directory, then symlinked according to
8689
In the previous example the output file actually linked to alacritty's config would look like this:
8790

8891
```yaml
89-
...
90-
# {dotfiles}/.dots/alacritty.yml
9192
colors:
9293
primary:
9394
background: "#292C3E"
9495
foreground: "#EBEBEB"
9596
cursor:
9697
text: "#FF261E"
9798
cursor: "#FF261E"
98-
# ...
9999
```
100100
101101
In the next section we will see how to organize our variables to make reusable structured themes using variable references.
Binary file not shown.

‎website/themes/adidoks/templates/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
{{ macros_head::favicons() }}
3030
{% block math %}{{ macros_math::math() }}{% endblock math %}
3131
</head>
32-
{% block body %}{% set page_class="home dark" %}{% endblock body %}
32+
{% block body %}{% set page_class="home" %}{% endblock body %}
3333
<body class="{{ page_class }}">
3434
{% block header %}
3535
{{ macros_header::header(current_section="/") }}

0 commit comments

Comments
 (0)
Please sign in to comment.