Add syntax-highlighting in the documentation
Part-of: <https://gitlab.gnome.org/World/Phosh/squeekboard/-/merge_requests/642>
This commit is contained in:
@ -38,7 +38,7 @@ See `.gitlab-ci.yml` or run `apt-get build-dep .`
|
|||||||
|
|
||||||
### Build from git repo
|
### Build from git repo
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
$ git clone https://gitlab.gnome.org/World/Phosh/squeekboard.git
|
$ git clone https://gitlab.gnome.org/World/Phosh/squeekboard.git
|
||||||
$ cd squeekboard
|
$ cd squeekboard
|
||||||
$ mkdir _build
|
$ mkdir _build
|
||||||
@ -52,7 +52,7 @@ To run tests use `ninja test`. To install squeekboard run `ninja install`.
|
|||||||
Running
|
Running
|
||||||
-------
|
-------
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
$ phoc # if no compatible Wayland compositor is running yet
|
$ phoc # if no compatible Wayland compositor is running yet
|
||||||
$ cd ../build/
|
$ cd ../build/
|
||||||
$ src/squeekboard
|
$ src/squeekboard
|
||||||
@ -62,13 +62,13 @@ Squeekboard's panel will appear whenever a compatible application requests an in
|
|||||||
|
|
||||||
Squeekboard honors the gnome "screen-keyboard-enabled" setting. Either enable this through gnome-settings under accessibility or run:
|
Squeekboard honors the gnome "screen-keyboard-enabled" setting. Either enable this through gnome-settings under accessibility or run:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
$ gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true
|
$ gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true
|
||||||
```
|
```
|
||||||
|
|
||||||
Alternatively, force panel visibility manually with:
|
Alternatively, force panel visibility manually with:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
$ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true
|
$ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -76,13 +76,13 @@ Most common testing is done in CI. Occasionally, and for each release, do perfor
|
|||||||
|
|
||||||
#### Testing with an application
|
#### Testing with an application
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ python3 tools/entry.py
|
$ python3 tools/entry.py
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Testing visibility
|
#### Testing visibility
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true
|
$ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true
|
||||||
$ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false
|
$ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false
|
||||||
```
|
```
|
||||||
@ -91,7 +91,7 @@ $ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false
|
|||||||
|
|
||||||
Available Layouts can be selected by using the GNOME Settings application.
|
Available Layouts can be selected by using the GNOME Settings application.
|
||||||
|
|
||||||
```
|
```sh
|
||||||
# define all available layouts. First one is currently selected.
|
# define all available layouts. First one is currently selected.
|
||||||
$ gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'de')]"
|
$ gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'de')]"
|
||||||
```
|
```
|
||||||
@ -100,7 +100,7 @@ $ gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb',
|
|||||||
|
|
||||||
Squeekboard prints some information on standard output by default. To get deep debugging information, it can also print all changes in (some of) its internal state. Those logs are most useful when reporting hard to catch issues, and can be enabled using the following command:
|
Squeekboard prints some information on standard output by default. To get deep debugging information, it can also print all changes in (some of) its internal state. Those logs are most useful when reporting hard to catch issues, and can be enabled using the following command:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ busctl set-property --user sm.puri.SqueekDebug /sm/puri/SqueekDebug sm.puri.SqueekDebug Enabled b true
|
$ busctl set-property --user sm.puri.SqueekDebug /sm/puri/SqueekDebug sm.puri.SqueekDebug Enabled b true
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ Coding
|
|||||||
|
|
||||||
Reference documentation can be generated using:
|
Reference documentation can be generated using:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ cd squeekboard_build/
|
$ cd squeekboard_build/
|
||||||
$ .../squeekboard_source/cargo.sh doc --no-deps --document-private-items
|
$ .../squeekboard_source/cargo.sh doc --no-deps --document-private-items
|
||||||
```
|
```
|
||||||
@ -149,7 +149,7 @@ Note that some portions, like the .gitlab-ci.yml file have accummulated enough s
|
|||||||
|
|
||||||
To fix your contributions before submitting a change, use:
|
To fix your contributions before submitting a change, use:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ ./tools/style-check_source --apply
|
$ ./tools/style-check_source --apply
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ Squeekboard uses Rust & Cargo for some of its dependencies.
|
|||||||
|
|
||||||
Use the `cargo.sh` script for maintaining the Cargo part of the build. The script takes the usual Cargo commands, after the first 2 positional arguments: source directory, and output artifact. So, `cargo test` becomes:
|
Use the `cargo.sh` script for maintaining the Cargo part of the build. The script takes the usual Cargo commands, after the first 2 positional arguments: source directory, and output artifact. So, `cargo test` becomes:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ cd build_dir
|
$ cd build_dir
|
||||||
$ sh /source_path/cargo.sh test
|
$ sh /source_path/cargo.sh test
|
||||||
```
|
```
|
||||||
@ -228,7 +228,7 @@ Squeekboard should get a new release every time something interesting comes in.
|
|||||||
|
|
||||||
While the file is not actually used, it's a good idea to save the config in case some rare bug appears in dependencies.
|
While the file is not actually used, it's a good idea to save the config in case some rare bug appears in dependencies.
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ cd squeekboard-build
|
$ cd squeekboard-build
|
||||||
$ .../squeekboard-source/cargo.sh update
|
$ .../squeekboard-source/cargo.sh update
|
||||||
$ ninja test
|
$ ninja test
|
||||||
@ -251,7 +251,7 @@ It's in the `project(version: xxx)` statement.
|
|||||||
|
|
||||||
Packaging is in the `debian/` directory, and creates builds that can be quickly tested.
|
Packaging is in the `debian/` directory, and creates builds that can be quickly tested.
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ cd squeekboard-source
|
$ cd squeekboard-source
|
||||||
$ EMAIL=my_address@example.com gbp dch --multimaint-merge --ignore-branch --git-author --distribution=experimental --new-version=x.y.z
|
$ EMAIL=my_address@example.com gbp dch --multimaint-merge --ignore-branch --git-author --distribution=experimental --new-version=x.y.z
|
||||||
```
|
```
|
||||||
@ -283,7 +283,7 @@ Changes:
|
|||||||
|
|
||||||
Generate a commit message from the NEWS file:
|
Generate a commit message from the NEWS file:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ tools/make_message | git commit --file=- ...
|
$ tools/make_message | git commit --file=- ...
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ If the commit message looks wrong, fix the NEWS file, and do `git commit --amend
|
|||||||
|
|
||||||
The tag should be the version number with "v" in front of it. The tag message should be "squeekboard" and the tag name. Push it to the upstream repository:
|
The tag should be the version number with "v" in front of it. The tag message should be "squeekboard" and the tag name. Push it to the upstream repository:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ git tag -s -u my_address@example.com v1.22.0 -m "squeekboard v1.22.0"
|
$ git tag -s -u my_address@example.com v1.22.0 -m "squeekboard v1.22.0"
|
||||||
$ git push origin v1.22.0
|
$ git push origin v1.22.0
|
||||||
```
|
```
|
||||||
|
|||||||
@ -36,7 +36,7 @@ The layout file follows the YAML syntax, with specific meanings given to section
|
|||||||
|
|
||||||
The "outlines" dictionary controls the widths and heights of buttons.
|
The "outlines" dictionary controls the widths and heights of buttons.
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
outlines:
|
outlines:
|
||||||
default: { width: 32, height: 52 }
|
default: { width: 32, height: 52 }
|
||||||
```
|
```
|
||||||
@ -52,7 +52,7 @@ There may be any number of outlines, but there are some special names:
|
|||||||
|
|
||||||
The "views" dictionary contains the actual views and positions of buttons.
|
The "views" dictionary contains the actual views and positions of buttons.
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
views:
|
views:
|
||||||
base:
|
base:
|
||||||
- "q w e r t y u i o p å"
|
- "q w e r t y u i o p å"
|
||||||
@ -64,7 +64,7 @@ There is only one special view "base". Views and view switching are described in
|
|||||||
|
|
||||||
Views in Squeekboard are based on rows. The first row comes near the top of the panel, the next one below, and so on.
|
Views in Squeekboard are based on rows. The first row comes near the top of the panel, the next one below, and so on.
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
- "Q W E R T Y U I O P Å"
|
- "Q W E R T Y U I O P Å"
|
||||||
- "upper z x c v b n m BackSpace"
|
- "upper z x c v b n m BackSpace"
|
||||||
```
|
```
|
||||||
@ -81,7 +81,7 @@ Similarly, buttons that do not emit characters must have some names.
|
|||||||
|
|
||||||
The buttons section describes what the button looks like and what it does.
|
The buttons section describes what the button looks like and what it does.
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
BackSpace:
|
BackSpace:
|
||||||
outline: altline
|
outline: altline
|
||||||
icon: "edit-clear-symbolic"
|
icon: "edit-clear-symbolic"
|
||||||
@ -102,7 +102,7 @@ The button description can have a number of components, each optional. For detai
|
|||||||
|
|
||||||
#### Action
|
#### Action
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
action:
|
action:
|
||||||
set_view: "numbers"
|
set_view: "numbers"
|
||||||
```
|
```
|
||||||
|
|||||||
@ -22,7 +22,7 @@ Creating a layout is easy. You don't need to recompile things, just edit and tes
|
|||||||
* Select and enable the input source you would like to change from the Region & Language section of the device settings. Perhaps use "A user-defined custom layout" listed under Other.
|
* Select and enable the input source you would like to change from the Region & Language section of the device settings. Perhaps use "A user-defined custom layout" listed under Other.
|
||||||
* Find the correct name of the .yaml file associated with that input source. This can be found with the command
|
* Find the correct name of the .yaml file associated with that input source. This can be found with the command
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ gsettings get org.gnome.desktop.input-sources sources
|
$ gsettings get org.gnome.desktop.input-sources sources
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ The yaml file will overwrite the default settings for that layout. If you want t
|
|||||||
|
|
||||||
You can also use the `test_layout` tool from the -devel package to check it for errors:
|
You can also use the `test_layout` tool from the -devel package to check it for errors:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ squeekboard_test_layout ./mylayout.yaml
|
$ squeekboard_test_layout ./mylayout.yaml
|
||||||
Test result: OK
|
Test result: OK
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user