Docs: Put example commands in code blocks

This commit is contained in:
pagedown
2022-09-01 15:35:51 +08:00
parent 1b42486026
commit 922ce5bdea
5 changed files with 13 additions and 8 deletions

View File

@@ -165,12 +165,14 @@ type=list
Restrict the actions remote control is allowed to take. This works like Restrict the actions remote control is allowed to take. This works like
:opt:`remote_control_password`. You can specify a password and list of actions :opt:`remote_control_password`. You can specify a password and list of actions
just as for :opt:`remote_control_password`. For example:: just as for :opt:`remote_control_password`. For example::
--remote-control-password '"my passphrase" get-* set-colors' --remote-control-password '"my passphrase" get-* set-colors'
This password will be in effect for this window only. This password will be in effect for this window only.
Note that any passwords you have defined for :opt:`remote_control_password` Note that any passwords you have defined for :opt:`remote_control_password`
in :file:`kitty.conf` are also in effect. You can override them by using the same password here. in :file:`kitty.conf` are also in effect. You can override them by using the same password here.
You can also disable all :opt:`remote_control_password` global passwords for this window, by using:: You can also disable all :opt:`remote_control_password` global passwords for this window, by using::
--remote-control-password '!' --remote-control-password '!'
This option only takes effect if :option:`--allow-remote-control` This option only takes effect if :option:`--allow-remote-control`
@@ -271,8 +273,9 @@ effect if :option:`--logo` is specified. See :opt:`window_logo_alpha`.
type=list type=list
Change colors in the newly launched window. You can either specify a path to a 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 :file:`.conf` file with the same syntax as :file:`kitty.conf` to read the colors
from, or specify them individually, for example: :code:`--color background=white from, or specify them individually, for example::
--color foreground=red`.
--color background=white --color foreground=red
--watcher -w --watcher -w

View File

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

View File

@@ -34,8 +34,8 @@ class NewWindow(RemoteCommand):
' Prints out the id of the newly opened window' ' Prints out the id of the newly opened window'
' (unless :option:`--no-response` is used). Any command line arguments' ' (unless :option:`--no-response` is used). Any command line arguments'
' are assumed to be the command line used to run in the new window, if none' ' 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:\n' ' are provided, the default shell is run. For example::\n\n'
':code:`kitty @ new-window --title Email mutt`' ' kitty @ new-window --title Email mutt'
) )
options_spec = MATCH_TAB_OPTION + '''\n options_spec = MATCH_TAB_OPTION + '''\n
--title --title

View File

@@ -27,7 +27,8 @@ class SetBackgroundOpacity(RemoteCommand):
desc = ( desc = (
'Set the background opacity for the specified windows. This will only work if you have turned on' 'Set the background opacity for the specified windows. This will only work if you have turned on'
' :opt:`dynamic_background_opacity` in :file:`kitty.conf`. The background opacity affects all kitty windows in a' ' :opt:`dynamic_background_opacity` in :file:`kitty.conf`. The background opacity affects all kitty windows in a'
' single OS window. For example: :code:`kitty @ set-background-opacity 0.5`' ' single OS window. For example::\n\n'
' kitty @ set-background-opacity 0.5'
) )
options_spec = '''\ options_spec = '''\
--all -a --all -a

View File

@@ -68,7 +68,8 @@ class SetColors(RemoteCommand):
'Set the terminal colors for the specified windows/tabs (defaults to active window).' 'Set the terminal colors for the specified windows/tabs (defaults to active window).'
' You can either specify the path to a conf file' ' You can either specify the path to a conf file'
' (in the same format as :file:`kitty.conf`) to read the colors from or you can specify individual colors,' ' (in the same format as :file:`kitty.conf`) to read the colors from or you can specify individual colors,'
' for example: :code:`kitty @ set-colors foreground=red background=white`' ' for example::\n\n'
' kitty @ set-colors foreground=red background=white'
) )
options_spec = '''\ options_spec = '''\
--all -a --all -a