Docs: Improve documentation for remote commands

Use text roles in the document to apply the style in the cli output.
Add more links.
Unify the text roles.
Use code blocks instead of quote blocks.
Use '+' to connect the shortcut key names.
This commit is contained in:
pagedown 2022-06-28 11:52:20 +08:00
parent 185d959f25
commit 1411269187
No known key found for this signature in database
GPG Key ID: E921CF18AC8FF6EB
7 changed files with 15 additions and 15 deletions

View File

@ -181,15 +181,15 @@ the same as for the :ac:`toggle_marker` action (see :doc:`/marks`).
--os-window-class
Set the *WM_CLASS* property on X11 and the application id property on Wayland
for the newly created OS window when using :option:`--type=os-window
Set the :italic:`WM_CLASS` property on X11 and the application id property on
Wayland for the newly created OS window when using :option:`--type=os-window
<launch --type>`. Defaults to whatever is used by the parent kitty process,
which in turn defaults to :code:`kitty`.
--os-window-name
Set the *WM_NAME* property on X11 for the newly created OS Window when using
:option:`--type=os-window <launch --type>`. Defaults to
Set the :italic:`WM_NAME` property on X11 for the newly created OS Window when
using :option:`--type=os-window <launch --type>`. Defaults to
:option:`--os-window-class <launch --os-window-class>`.
@ -220,8 +220,8 @@ effect if :option:`--logo` is specified. See :opt:`window_logo_position`.
type=list
Change colors in the newly launched window. You can either specify a path to a
:file:`.conf` file with the same syntax as :file:`kitty.conf` to read the colors
from, or specify them individually, for example: ``--color background=white``
``--color foreground=red``
from, or specify them individually, for example: :code:`--color background=white
--color foreground=red`.
--watcher -w

View File

@ -87,7 +87,7 @@ For numeric fields: :code:`id`, :code:`pid`, :code:`num` and :code:`recent`, the
a number, not a regular expression.
The field :code:`num` refers to the window position in the current tab, starting from zero and counting clockwise (this
is the same as the order in which the windows are reported by the :italic:`ls` command).
is the same as the order in which the windows are reported by the :ref:`kitty @ ls <at_ls>` command).
The window id of the current window is available as the :envvar:`KITTY_WINDOW_ID` environment variable.
@ -95,7 +95,7 @@ The field :code:`recent` refers to recently active windows in the currently acti
active window, one being the previously active window and so on.
When using the :code:`env` field to match on environment variables, you can specify only the environment variable name
or a name and value, for example, :italic:`env:MY_ENV_VAR=2`.
or a name and value, for example, :code:`env:MY_ENV_VAR=2`.
The field :code:`state` matches on the state of the window. Supported states are:
:code:`active`, :code:`focused`, :code:`needs_attention`, :code:`parent_active` and :code:`parent_focused`.
@ -128,7 +128,7 @@ The :code:`recent` number matches recently active tabs in the currently active O
active tab, one the previously active tab and so on.
When using the :code:`env` field to match on environment variables, you can specify only the environment variable name
or a name and value, for example, :italic:`env:MY_ENV_VAR=2`. Tabs containing any window with the specified environment
or a name and value, for example, :code:`env:MY_ENV_VAR=2`. Tabs containing any window with the specified environment
variables are matched.
The field :code:`state` matches on the state of the tab. Supported states are:

View File

@ -24,7 +24,7 @@ class CloseTab(RemoteCommand):
desc = '''\
Close an arbitrary set of tabs. The :code:`--match` option can be used to
specify complex sets of tabs to close. For example, to close all non-focused
tabs in the currently focused OS window, use:
tabs in the currently focused OS window, use::
kitty @ close-tab --match "not state:focused and state:parent_focused"
'''

View File

@ -51,8 +51,8 @@ class Launch(RemoteCommand):
desc = (
'Prints out the id of the newly opened window. Any command line arguments'
' are assumed to be the command line used to run in the new window, if none'
' are provided, the default shell is run. For example:'
' :code:`kitty @ launch --title=Email mutt`.'
' are provided, the default shell is run. For example:\n'
':code:`kitty @ launch --title=Email mutt`'
)
options_spec = MATCH_TAB_OPTION + '\n\n' + '''\
--no-response

View File

@ -28,7 +28,7 @@ class NewWindow(RemoteCommand):
short_desc = 'Open new window'
desc = (
'DEPRECATED: Use the launch command instead.\n\n'
'DEPRECATED: Use the :ref:`launch <at_launch>` command instead.\n\n'
'Open a new window in the specified tab. If you use the :option:`kitty @ new-window --match` option'
' the first matching tab is used. Otherwise the currently active tab is used.'
' Prints out the id of the newly opened window'

View File

@ -27,7 +27,7 @@ class ScrollWindow(RemoteCommand):
desc = (
'Scroll the specified windows, if no window is specified, scroll the window this command is run inside.'
' :italic:`SCROLL_AMOUNT` can be either the keywords :code:`start` or :code:`end` or an'
' argument of the form <number>[unit][+-]. For example, :code:`30` will scroll down 30 lines and :code:`2p-`'
' argument of the form :italic:`<number>[unit][+-]`. For example, :code:`30` will scroll down 30 lines and :code:`2p-`'
' will scroll up 2 pages. :code:`3u` will *unscroll* by 3 lines, which means that 3 lines will move from the'
' scrollback buffer onto the top of the screen.'
)

View File

@ -93,7 +93,7 @@ Do not send text to the active window, even if it is one of the matched windows.
--stdin
type=bool-set
Read the text to be sent from :italic:`stdin`. Note that in this case the text is sent as is,
not interpreted for escapes. If stdin is a terminal, you can press :kbd:`Ctrl-D` to end reading.
not interpreted for escapes. If stdin is a terminal, you can press :kbd:`Ctrl+D` to end reading.
--from-file