From 329d95fd3a5521c206a08784ce00c44d5bd22f44 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 21 Jul 2021 10:35:58 +0530 Subject: [PATCH] Include all in page headings in the sidebar ToC The furo theme tries to make this impossible, fortunately, this being python, we dont care what it wants --- docs/actions.rst | 2 +- docs/conf.py | 10 +++++++++- docs/conf.rst | 4 ++-- docs/glossary.rst | 5 +++++ docs/index.rst | 2 +- docs/kittens_intro.rst | 4 ++-- docs/launch.rst | 4 ++-- docs/layouts.rst | 2 +- docs/marks.rst | 5 ++++- docs/overview.rst | 8 ++------ docs/remote-control.rst | 8 ++++---- 11 files changed, 33 insertions(+), 21 deletions(-) diff --git a/docs/actions.rst b/docs/actions.rst index 98e476824..144fc52f7 100644 --- a/docs/actions.rst +++ b/docs/actions.rst @@ -1,5 +1,5 @@ Mappable actions -================== +----------------------- .. highlight:: conf diff --git a/docs/conf.py b/docs/conf.py index 1ccb915fa..cbfffc484 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -482,8 +482,16 @@ def write_conf_docs(app: Any, all_kitten_names: Iterable[str]) -> None: # }}} -def add_html_context(app: Any, pagename: str, templatename: str, context: Any, *args: Any) -> None: +def add_html_context(app: Any, pagename: str, templatename: str, context: Any, doctree: Any, *args: Any) -> None: context['analytics_id'] = app.config.analytics_id + if 'toctree' in context: + original_toctee_function = context['toctree'] + + def include_sub_headings(**kwargs: Any) -> Any: + kwargs['titles_only'] = False + return original_toctee_function(**kwargs) + + context['toctree'] = include_sub_headings def setup(app: Any) -> None: diff --git a/docs/conf.rst b/docs/conf.rst index 17fce5922..97746825e 100644 --- a/docs/conf.rst +++ b/docs/conf.rst @@ -1,5 +1,5 @@ -Configure kitty -=============================== +kitty.conf +----------------------- .. highlight:: conf diff --git a/docs/glossary.rst b/docs/glossary.rst index 3342b1d51..68526c8e9 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -34,6 +34,11 @@ Glossary to display :doc:`hints `, for :doc:`unicode input ` etc. + hyperlinks + Terminals can have hyperlinks, just like the internet. In kitty you can + :doc:`control exactly what happens ` when clicking on a + hyperlink, based on the type of link and its URL. + .. _env_vars: Environment variables diff --git a/docs/index.rst b/docs/index.rst index af24ed410..b7fb87135 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -26,7 +26,7 @@ kitty * Graphics, with :doc:`images and animations ` * Ligatures and emoji, with :opt:`per glyph font substitution ` - * Hyperlinks, with :doc:`configurable actions ` + * :term:`Hyperlinks`, with :doc:`configurable actions ` .. tab:: Scriptable diff --git a/docs/kittens_intro.rst b/docs/kittens_intro.rst index 567a4700a..b34ed2db9 100644 --- a/docs/kittens_intro.rst +++ b/docs/kittens_intro.rst @@ -1,7 +1,7 @@ .. _kittens: -Extend kitty -================ +Extend with kittens +----------------------- .. toctree:: :hidden: diff --git a/docs/launch.rst b/docs/launch.rst index 2bb850021..10e44c127 100644 --- a/docs/launch.rst +++ b/docs/launch.rst @@ -1,5 +1,5 @@ -Launching new tabs/windows -======================================== +The :command:`launch` command +-------------------------------- .. program:: launch diff --git a/docs/layouts.rst b/docs/layouts.rst index 17d2d0901..2f01844a2 100644 --- a/docs/layouts.rst +++ b/docs/layouts.rst @@ -1,5 +1,5 @@ Arrange windows -=================== +------------------- kitty has the ability to define its own windows that can be tiled next to each other in arbitrary arrangements, based on *Layouts*, see below for examples: diff --git a/docs/marks.rst b/docs/marks.rst index 1904be160..afb1e5ad1 100644 --- a/docs/marks.rst +++ b/docs/marks.rst @@ -1,11 +1,14 @@ Mark text on screen -======================== +--------------------- kitty has the ability to mark text on the screen based on regular expressions. This can be useful to highlight words or phrases when browsing output from long running programs or similar. Lets start with a few examples: +Examples +---------- + Suppose we want to be able to highlight the word ERROR in the current window. Add the following to :file:`kitty.conf`:: diff --git a/docs/overview.rst b/docs/overview.rst index de43d81ef..044fed4fb 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -163,7 +163,7 @@ For example: cannot create new OS windows, or tabs. -Launching new tabs/windows +Creating tabs/windows ------------------------------- kitty can be told to run arbitrary programs in new :term:`tabs `, @@ -197,11 +197,7 @@ Mouse features All these actions can be customized in :file:`kitty.conf` as described :ref:`here `. - -Scripting the mouse click ---------------------------- - -You can customize what happens when clicking on hyperlinks in kitty, +You can also customize what happens when clicking on :term:`hyperlinks` in kitty, having it open files in your editor, download remote files, open things in your browser, etc. diff --git a/docs/remote-control.rst b/docs/remote-control.rst index cca38976c..36c762bed 100644 --- a/docs/remote-control.rst +++ b/docs/remote-control.rst @@ -1,15 +1,15 @@ Control kitty from scripts -============================================== +---------------------------- .. highlight:: sh -Tutorial ----------- - |kitty| can be controlled from scripts or the shell prompt. You can open new windows, send arbitrary text input to any window, name windows and tabs, etc. Let's walk through a few examples of controlling |kitty|. +Tutorial +------------ + Start by running |kitty| as:: kitty -o allow_remote_control=yes -o enabled_layouts=tall