Skip to content

Commit

Permalink
docs: upgrade theme and minor fixes (#245)
Browse files Browse the repository at this point in the history
* docs: upgrade theme and minor fixes

* docs: update default settings for highlight

* docs: refactoring :)

* Fixes "go to top" link in updated relearn theme

* docs: add setcap draft

* docs: final tweaks

---------

Co-authored-by: jkellerer <[email protected]>
  • Loading branch information
creativeprojects and jkellerer authored Aug 11, 2023
1 parent 9c05157 commit 1024189
Show file tree
Hide file tree
Showing 41 changed files with 479 additions and 431 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ generate-config-reference: build
LAYOUT_NOTICE_END="{{% /notice %}}" \
LAYOUT_HINT_START="{{% notice hint %}}" \
LAYOUT_HINT_END="{{% /notice %}}" \
LAYOUT_UPLINK="[go to top](#topbar)" \
LAYOUT_UPLINK="[go to top](#reference)" \
$(abspath $(BINARY)) generate --config-reference > $(CONFIG_REFERENCE_DIR)/index.md

syslog:
Expand Down
21 changes: 20 additions & 1 deletion docs/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publishdir = "../public/"

# For search functionality
[outputs]
home = [ "HTML", "RSS", "JSON"]
home = [ "HTML", "RSS", "SEARCH", "SEARCHPAGE"]

[params]
# Change default color scheme with a variant one.
Expand All @@ -30,3 +30,22 @@ publishdir = "../public/"
identifier = "resticdoc"
url = "https://restic.readthedocs.io/"
weight = 30

[markup]
[markup.highlight]
# line numbers in a table layout will shift if code is wrapping, so better
# use inline; besides that visually both layouts have the same look and behavior
lineNumbersInTable = false

# if `guessSyntax = true`, there will be no unstyled code even if no language
# was given BUT Mermaid and Math codefences will not work anymore! So this is a
# mandatory setting for your site if you want to use Mermaid or Math codefences
guessSyntax = false

# the shipped variants come with their own modified chroma syntax highlightning
# style which is imported in theme-relearn-light.css, theme-relearn-dark.css, etc.;
# if you want to use a predefined style instead:
# - remove `noClasses` or set `noClasses = true`
# - set `style` to a predefined style name
noClasses = false
# style = "tango"
3 changes: 3 additions & 0 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
archetype: "home"
---

# resticprofile
Configuration profiles manager for [restic backup](https://restic.net/)
Expand Down
34 changes: 16 additions & 18 deletions docs/content/configuration/_index.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
+++
chapter = true
archetype = "chapter"
pre = "<b>2. </b>"
title = "Configuration"
weight = 10
title = "Configuration file"
weight = 2
+++


# Configuration file

* A configuration is a set of _profiles_.
* Each profile is in a new section that has the name of the profile.
* Inside each profile, you can specify different flags for each command.
* A command definition is in a subsection of the name of the command.

{{< tabs groupId="config-with-json" >}}
{{% tab name="toml" %}}
{{< tabs groupid="config-with-json" >}}
{{% tab title="toml" %}}

```toml
[profile_name]
Expand All @@ -24,7 +22,7 @@ weight = 10
```

{{% /tab %}}
{{% tab name="yaml" %}}
{{% tab title="yaml" %}}

```yaml
profile_name:
Expand All @@ -34,7 +32,7 @@ profile_name:
```

{{% /tab %}}
{{% tab name="hcl" %}}
{{% tab title="hcl" %}}

```hcl
profile_name {
Expand All @@ -46,7 +44,7 @@ profile_name {
```

{{% /tab %}}
{{% tab name="json" %}}
{{% tab title="json" %}}

```json
{
Expand All @@ -72,13 +70,13 @@ There's **one exception**: the flag `--repo` is named `repository` in the config
So let's say you normally use this simple command:

```shell
$ restic --repo "local:/backup" --password-file "password.txt" --verbose backup /home
restic --repo "local:/backup" --password-file "password.txt" --verbose backup /home
```

For resticprofile to generate this command automatically for you, here's the configuration file:

{{< tabs groupId="config-with-json" >}}
{{% tab name="toml" %}}
{{< tabs groupid="config-with-json" >}}
{{% tab title="toml" %}}

```toml
# indentation is not needed but it makes it easier to read ;)
Expand All @@ -95,7 +93,7 @@ version = "1"
```

{{% /tab %}}
{{% tab name="yaml" %}}
{{% tab title="yaml" %}}

```yaml
version: "1"
Expand All @@ -111,7 +109,7 @@ default:
```
{{% /tab %}}
{{% tab name="hcl" %}}
{{% tab title="hcl" %}}
```hcl
default {
Expand All @@ -126,7 +124,7 @@ default {
```

{{% /tab %}}
{{% tab name="json" %}}
{{% tab title="json" %}}

```json
{
Expand All @@ -153,15 +151,15 @@ You may have noticed the `source` flag is accepting an array of values (inside b
Now, assuming this configuration file is named `profiles.conf` in the current folder (it's the default config file name), you can simply run

```shell
$ resticprofile backup
resticprofile backup
```

and resticprofile will do its magic and generate the command line for you.

If you have any doubt on what it's running, you can try a `--dry-run`:

```shell
$ resticprofile --dry-run backup
resticprofile --dry-run backup
2022/05/18 17:14:07 profile 'default': starting 'backup'
2022/05/18 17:14:07 dry-run: /usr/bin/restic backup --password-file password.txt --repo local:/backup --verbose /home
2022/05/18 17:14:07 profile 'default': finished 'backup'
Expand Down
16 changes: 8 additions & 8 deletions docs/content/configuration/copy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ weight: 17
The copy command needs two repositories (and quite likely 2 different set of keys). You can configure a `copy` section like this:


{{< tabs groupId="config-with-hcl" >}}
{{% tab name="toml" %}}
{{< tabs groupid="config-with-hcl" >}}
{{% tab title="toml" %}}

```toml
version = "1"
Expand All @@ -29,7 +29,7 @@ version = "1"
```

{{% /tab %}}
{{% tab name="yaml" %}}
{{% tab title="yaml" %}}

```yaml
version: "1"
Expand All @@ -45,7 +45,7 @@ default:
```
{{% /tab %}}
{{% tab name="hcl" %}}
{{% tab title="hcl" %}}
```hcl
Expand All @@ -72,8 +72,8 @@ You will note that the secondary repository doesn't need to have a `2` behind it
If you want to initialize the *copy* repository using the `copy-chunker-params` flag, it needs to be called `initialize-copy-chunker-params` instead. As such, this flag does not exist on the `copy` target which is why we need to prefix it.


{{< tabs groupId="config-with-hcl" >}}
{{% tab name="toml" %}}
{{< tabs groupid="config-with-hcl" >}}
{{% tab title="toml" %}}

```toml
version = "1"
Expand All @@ -91,7 +91,7 @@ version = "1"
```

{{% /tab %}}
{{% tab name="yaml" %}}
{{% tab title="yaml" %}}

```yaml
version: "1"
Expand All @@ -108,7 +108,7 @@ profile:
```
{{% /tab %}}
{{% tab name="hcl" %}}
{{% tab title="hcl" %}}
```hcl
Expand Down
32 changes: 16 additions & 16 deletions docs/content/configuration/examples/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ weight: 5

Here's a simple configuration file using a Microsoft Azure backend. You will notice that the `env` section lets you define environment variables:

{{< tabs groupId="config-with-hcl" >}}
{{% tab name="toml" %}}
{{< tabs groupid="config-with-hcl" >}}
{{% tab title="toml" %}}

```toml
version = "1"
Expand All @@ -31,7 +31,7 @@ version = "1"
source = [ "/", "/var" ]
```
{{% /tab %}}
{{% tab name="yaml" %}}
{{% tab title="yaml" %}}

```yaml
version: "1"
Expand All @@ -57,7 +57,7 @@ default:
```
{{% /tab %}}
{{% tab name="hcl" %}}
{{% tab title="hcl" %}}
```hcl
default {
Expand Down Expand Up @@ -87,8 +87,8 @@ default {

Here's a more complex configuration file showing profile inheritance and two backup profiles using the same repository:

{{< tabs groupId="config-with-hcl" >}}
{{% tab name="toml" %}}
{{< tabs groupid="config-with-hcl" >}}
{{% tab title="toml" %}}

```toml
version = "1"
Expand Down Expand Up @@ -213,7 +213,7 @@ version = "1"
```

{{% /tab %}}
{{% tab name="yaml" %}}
{{% tab title="yaml" %}}

```yaml
version: "1"
Expand Down Expand Up @@ -347,7 +347,7 @@ src:
```

{{% /tab %}}
{{% tab name="hcl" %}}
{{% tab title="hcl" %}}

```hcl
global {
Expand Down Expand Up @@ -428,8 +428,8 @@ self {
## Configuration example for Windows


{{< tabs groupId="config-with-hcl" >}}
{{% tab name="toml" %}}
{{< tabs groupid="config-with-hcl" >}}
{{% tab title="toml" %}}

```toml
version = "1"
Expand Down Expand Up @@ -463,7 +463,7 @@ version = "1"
```

{{% /tab %}}
{{% tab name="yaml" %}}
{{% tab title="yaml" %}}

```yaml
version: "1"
Expand Down Expand Up @@ -499,7 +499,7 @@ test:
```
{{% /tab %}}
{{% tab name="hcl" %}}
{{% tab title="hcl" %}}
```hcl
global {
Expand Down Expand Up @@ -535,8 +535,8 @@ test {

Simple example sending a file via stdin

{{< tabs groupId="config-with-hcl" >}}
{{% tab name="toml" %}}
{{< tabs groupid="config-with-hcl" >}}
{{% tab title="toml" %}}

```toml
version = "1"
Expand All @@ -561,7 +561,7 @@ version = "1"
```

{{% /tab %}}
{{% tab name="yaml" %}}
{{% tab title="yaml" %}}

```yaml
version: "1"
Expand All @@ -586,7 +586,7 @@ mysql:
```

{{% /tab %}}
{{% tab name="hcl" %}}
{{% tab title="hcl" %}}

```hcl
# sending stream through stdin
Expand Down
Loading

0 comments on commit 1024189

Please sign in to comment.