Skip to content

Commit

Permalink
Move to mdbook
Browse files Browse the repository at this point in the history
  • Loading branch information
elkowar committed Jun 22, 2021
1 parent 914d022 commit ba09262
Show file tree
Hide file tree
Showing 53 changed files with 2,133 additions and 1,844 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- ".github/workflows/**"
jobs:
build:
name: shalzz/zola-deploy-action
name: Build mdBook
runs-on: ubuntu-latest
steps:
# Checkout
Expand All @@ -24,9 +24,14 @@ jobs:
- run: deno run --allow-read --allow-write gen-docs.ts ./src/widgets/widget_definitions.rs ./src/config/inbuilt.rs

# Build & deploy
- name: shalzz/zola-deploy-action
uses: shalzz/[email protected]
env:
PAGES_BRANCH: gh-pages
BUILD_DIR: docs
TOKEN: ${{ secrets.TOKEN }}
- name: build mdBook page
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.4.8'
- run: mdbook build docs

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book/
2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
public
book
12 changes: 12 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[book]
authors = ["elkowar"]
language = "en"
multilingual = false
src = "src"
title = "eww documentation"


[output.html]
default-theme = "ayu"
no-section-label = true
git-repository-url = "https://github.com/elkowar/eww/tree/master/docs"
20 changes: 0 additions & 20 deletions docs/config.toml

This file was deleted.

6 changes: 0 additions & 6 deletions docs/content/main/widgets.md

This file was deleted.

51 changes: 0 additions & 51 deletions docs/sass/style.scss

This file was deleted.

10 changes: 10 additions & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Summary

- [Eww - Widgets for everyone!](./eww.md)
- [Configuration](./configuration.md)
- [Theming with GTK](./working_with_gtk.md)
- [Magic Variables](./magic-vars.md)
- [Widgets](./widgets.md)
- [Troubleshooting](./troubleshooting.md)
- [Eww expressions](./expression_language.md)
- [Examples](./examples.md)
34 changes: 14 additions & 20 deletions docs/content/main/configuration.md → docs/src/configuration.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
+++
title = "Configuration"
slug = "The basics of how to configure eww"
weight = 1
+++
# Configuration

## Configuration
For specific built in widgets `<box>, <text>, <slider>, etc` see [Widget Documentation](widgets.md)

For specific built in widgets `<box>, <text>, <slider>, etc` see [Widget Documentation](@/main/widgets.md)
## Placing the configuration file

### Placing the configuration file

Note: Example configuration files can be found in the `examples` directory of the repository and are showcased in [Examples](@/main/examples.md).
Note: Example configuration files can be found in the `examples` directory of the repository and are showcased in [Examples](examples.md).

The configuration file and the scss file should lay in `$XDG_CONFIG_HOME/eww` (or, if unset, `$HOME/.config/eww`). The XML file should be named `eww.xml` and the scss should be named `eww.scss`
So the directory structure should look like this:
Expand All @@ -22,7 +16,7 @@ $HOME
└──eww.scss
```

### Config structure
## Config structure

Your config structure should look like this:
```xml
Expand Down Expand Up @@ -50,12 +44,12 @@ See
[Variables](#variables) and the
[The `<windows>` block](#the-windows-block).

### Variables
## Variables

If you create a `<var>` or a `<script-var>`, you can reference them in your `<box>` by doing `{{var}}`. Where `var` is your variable name.


#### The `<var>` tag
### The `<var>` tag
Allows you to repeat the same text multiple times through without retyping it multiple times.

Example: This will define a variable named `banana`, with the default value "I like bananas."
Expand All @@ -74,7 +68,7 @@ You can then reference it in your widgets by doing:

To change the value of the variable, and thus change the UI, you can run `eww update banana "I like apples"`

#### The `<script-var>` tag
### The `<script-var>` tag

Allows you to create a script that eww runs.
Useful for creating volume sliders or anything similar.
Expand Down Expand Up @@ -106,7 +100,7 @@ Here are the available times you can set:
| h | Hours |


#### Tail
### Tail
If you don't want a set interval and instead want it to tail (run the script when it detects a change is present) you can simply remove the `interval="5s"` so it becomes:
```xml
<variables>
Expand All @@ -115,7 +109,7 @@ If you don't want a set interval and instead want it to tail (run the script whe
</script-var>
</variables>
```
### The `<includes>` block
## The `<includes>` block
Here you can include other config files so that they are merged together at startup. Currently namespaced variables are not supported so be careful when reusing code.

```xml
Expand All @@ -127,10 +121,10 @@ Here you can include other config files so that they are merged together at star

If you define a variable/widget/window, in a config file, when it's defined somewhere else, you can see a warning in the eww logs (`eww logs`)

### The `<definitions>` block
In here you whole widget will be made, and you can also create your own widgets. Check [Widget Documentation](@/main/widgets.md) for pre-defined widgets.
## The `<definitions>` block
In here you whole widget will be made, and you can also create your own widgets. Check [Widget Documentation](widgets.md) for pre-defined widgets.

#### Custom widgets
### Custom widgets

Let's get a small config and break it down.

Expand Down Expand Up @@ -205,7 +199,7 @@ To use that it would look like this:
</box>
</def>
```
### The `<windows>` block {#windows-block}
## The `<windows>` block

All different windows you might want to use are defined in the `<windows>` block.
The `<windows>` config should look something like this:
Expand Down
13 changes: 4 additions & 9 deletions docs/content/main/_index.md → docs/src/eww.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
+++
title = "Eww - Widgets for everyone!"
slug = "eww"
sort_by = "weight"
+++

# Eww - Widgets for everyone!

Eww (ElKowar's Wacky Widgets, pronounced with sufficient amounts of disgust)
is a widgeting system made in [rust](https://www.rust-lang.org/),
is a widget system made in [rust](https://www.rust-lang.org/),
which let's you create your own widgets similarly to how you can in AwesomeWM.
The key difference: It is independent of your window manager!

Expand All @@ -32,7 +27,7 @@ First clone the repo:
```bash
git clone https://github.com/elkowar/eww
```
then enter it.

```bash
cd eww
```
Expand Down Expand Up @@ -60,4 +55,4 @@ and then to run it do
./eww daemon
./eww open <window_name>
```
`<window_name>` is the name of the window, see [The windows block](@/main/configuration.md#windows-block).
`<window_name>` is the name of the window, see [The windows block](configuration.md#windows-block).
8 changes: 1 addition & 7 deletions docs/content/main/examples.md → docs/src/examples.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
+++
title = "Examples"
slug = "Sample configs"
weight = 6
+++

## Example Configurations

These configurations of eww are available in the `examples/` directory of the [repo](https://github.com/elkowar/eww).

An eww bar configuration:
![Example 1](./examples/eww-bar/eww-bar.png)
![Example bar](https://github.com/elkowar/eww/raw/master/examples/eww-bar/eww-bar.png)
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
+++
title = "Eww expressions"
slug = "Embedded eww expression language"
weight = 5
+++

# The embedded Eww expression-language

Within variable references, you can make use of a small, built-in expression language.
Expand Down
9 changes: 1 addition & 8 deletions docs/content/main/magic-vars.md → docs/src/magic-vars.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
+++
title = "Magic Variables"
slug = "magic variables documenation"
weight = 3
+++
# Magic variables

These are variables that are always there, without you having to import them.

The delay between the updating variables is always 2s.


## Updating magic variables

Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
+++
title = "Troubleshooting"
slug = "troubleshooting"
weight = 4
+++

## Troubleshooting
# Troubleshooting

Here you will find help if something doesn't work, if the issue isn't listed here please [open an issue on the GitHub repo.](https://github.com/elkowar/eww/issues)

### Eww does not compile
## Eww does not compile

1. Make sure that you are compiling eww using the nightly rust toolchain.
2. Make sure you have all the necessary dependencies. If there are compile-errors, the compiler will tell you what you're missing.

### Eww does not work on wayland
## Eww does not work on wayland

1. Make sure you compiled eww with the `--no-default-features --features=wayland` flags.
2. Make sure that you're not trying to use X11-specific features (these are (hopefully) explicitly specified as such in the documentation).

### My scss isn't being loaded!
## My scss isn't being loaded!

1. You have not created a scss file
2. The scss file isn't called correctly. (it should be called `eww.scss` in the `$HOME/.config/eww` folder)
3. The scss file isn't placed in the correct location (check above)

If none of these fixed your problem [open an issue on the GitHub repo](https://github.com/elkowar/eww/issues), or check the [GTK-Debugger](@/main/working_with_gtk.md#gtk-debugger).
If none of these fixed your problem [open an issue on the GitHub repo](https://github.com/elkowar/eww/issues), or check the [GTK-Debugger](working_with_gtk.md#gtk-debugger).

### Eww can't find my configuration file!
## Eww can't find my configuration file!

1. It's incorrectly named or it's in the wrong place (it should be called `eww.xml` in the `$HOME/.config/eww` folder)
2. You haven't started eww correctly or you started it wrong.

### Something isn't styled correctly!
## Something isn't styled correctly!

1. You have mistyped the CSS class.
2. Check the [GTK-Debugger](@/main/working_with_gtk.md#gtk-debugger)
2. Check the [GTK-Debugger](working_with_gtk.md#gtk-debugger)

### General issues
## General issues

You should try the following things, before opening a issue or doing more specialized troubleshooting:

Expand Down
2 changes: 2 additions & 0 deletions docs/src/widgets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Widgets

Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
+++
title = "Theming with GTK"
slug = "How to use GTK-theming in Eww"
weight = 2
+++
# GTK

## GTK

### Gtk-theming
## Gtk-theming

Eww is styled in GTK CSS.
To make theming even easier, it makes use of `scss` and then compiles that into CSS for you.
Expand All @@ -18,7 +12,7 @@ If you have **NO** clue about how to do CSS, check out some online guides or tut

SCSS is _very_ close to CSS so if you know CSS you'll have no problem learning SCSS.

### GTK-Debugger {#gtk-debugger}
## GTK-Debugger

The debugger can be used for **a lot** of things. Especially if something doesn't work or isn't styled right. to enable it launch your eww daemon with

Expand Down
Binary file removed docs/static/favicon.ico
Binary file not shown.
5 changes: 0 additions & 5 deletions docs/templates/index.html

This file was deleted.

Loading

0 comments on commit ba09262

Please sign in to comment.