Use program directives to namespace options
This commit is contained in:
parent
a3e4c74f5d
commit
f8fa76d77e
@ -267,7 +267,7 @@ def add_html_context(app, pagename, templatename, context, *args):
|
|||||||
def write_cli_docs():
|
def write_cli_docs():
|
||||||
from kitty.cli import option_spec_as_rst
|
from kitty.cli import option_spec_as_rst
|
||||||
with open('generated/cli-kitty.rst', 'w') as f:
|
with open('generated/cli-kitty.rst', 'w') as f:
|
||||||
f.write(option_spec_as_rst(appname='kitty'))
|
f.write(option_spec_as_rst(appname='kitty').replace('kitty --to', 'kitty @ --to'))
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|||||||
@ -242,7 +242,7 @@ Startup Sessions
|
|||||||
------------------
|
------------------
|
||||||
|
|
||||||
You can control the tabs, window layout, working directory, startup
|
You can control the tabs, window layout, working directory, startup
|
||||||
programs, etc. by creating a "session" file and using the :option:`--session`
|
programs, etc. by creating a "session" file and using the :option:`kitty --session`
|
||||||
command line flag. For example:
|
command line flag. For example:
|
||||||
|
|
||||||
.. code-block:: ini
|
.. code-block:: ini
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
The kitty command line interface
|
The kitty command line interface
|
||||||
====================================
|
====================================
|
||||||
|
|
||||||
|
.. program:: kitty
|
||||||
|
|
||||||
.. include:: generated/cli-kitty.rst
|
.. include:: generated/cli-kitty.rst
|
||||||
|
|||||||
@ -416,7 +416,7 @@ def seq_as_rst(seq, usage, message, appname):
|
|||||||
t = re.sub(r':$', '::', t, flags=re.MULTILINE)
|
t = re.sub(r':$', '::', t, flags=re.MULTILINE)
|
||||||
t = t.replace('::\n\n\t ', '::\n \n ')
|
t = t.replace('::\n\n\t ', '::\n \n ')
|
||||||
t = t.replace('\n\n\t ', '\n \n')
|
t = t.replace('\n\n\t ', '\n \n')
|
||||||
t = re.sub(r'(--[a-zA-Z0-9-]+)', r':option:`\1` ', t)
|
t = re.sub(r'(--[a-zA-Z0-9-]+)', r':option:`{} \1` '.format(appname), t)
|
||||||
t = re.sub('"(.+?)"', r'``\1``', t)
|
t = re.sub('"(.+?)"', r'``\1``', t)
|
||||||
a(textwrap.indent(prettify_rst(t), ' ' * 4))
|
a(textwrap.indent(prettify_rst(t), ' ' * 4))
|
||||||
if defval is not None:
|
if defval is not None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user