From cff687d77829dc52e21336c7634ba8d8054314a6 Mon Sep 17 00:00:00 2001 From: MoonlightWave-12 <135532-MoonlightWave-12@users.noreply.gitlab.gnome.org> Date: Sun, 14 Apr 2024 13:38:20 +0200 Subject: [PATCH] Add syntax-highlighting in the documentation Part-of: --- README.md | 8 ++++---- doc/hacking.md | 22 +++++++++++----------- doc/layouts.md | 10 +++++----- doc/tutorial.md | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index e19fa1a3..22126904 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ See `.gitlab-ci.yml` or run `apt-get build-dep .` ### Build from git repo -```bash +```sh $ git clone https://gitlab.gnome.org/World/Phosh/squeekboard.git $ cd squeekboard $ mkdir _build @@ -52,7 +52,7 @@ To run tests use `ninja test`. To install squeekboard run `ninja install`. Running ------- -```bash +```sh $ phoc # if no compatible Wayland compositor is running yet $ cd ../build/ $ 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: -```bash +```sh $ gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true ``` Alternatively, force panel visibility manually with: -```bash +```sh $ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true ``` diff --git a/doc/hacking.md b/doc/hacking.md index 97a25850..06ad04c4 100644 --- a/doc/hacking.md +++ b/doc/hacking.md @@ -76,13 +76,13 @@ Most common testing is done in CI. Occasionally, and for each release, do perfor #### Testing with an application -``` +```sh $ python3 tools/entry.py ``` #### 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 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. -``` +```sh # define all available layouts. First one is currently selected. $ 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: -``` +```sh $ 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: -``` +```sh $ cd squeekboard_build/ $ .../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: -``` +```sh $ ./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: -``` +```sh $ cd build_dir $ 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. -``` +```sh $ cd squeekboard-build $ .../squeekboard-source/cargo.sh update $ 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. -``` +```sh $ cd squeekboard-source $ 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: -``` +```sh $ 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: -``` +```sh $ git tag -s -u my_address@example.com v1.22.0 -m "squeekboard v1.22.0" $ git push origin v1.22.0 ``` diff --git a/doc/layouts.md b/doc/layouts.md index 9675bc99..4d278aeb 100644 --- a/doc/layouts.md +++ b/doc/layouts.md @@ -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. -``` +```yaml outlines: 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. -``` +```yaml views: base: - "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. -``` +```yaml - "Q W E R T Y U I O P Å" - "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. -``` +```yaml BackSpace: outline: altline icon: "edit-clear-symbolic" @@ -102,7 +102,7 @@ The button description can have a number of components, each optional. For detai #### Action -``` +```yaml action: set_view: "numbers" ``` diff --git a/doc/tutorial.md b/doc/tutorial.md index a1269b57..97009ffe 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -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. * 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 ``` @@ -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: -``` +```sh $ squeekboard_test_layout ./mylayout.yaml Test result: OK ```