diff options
author | Jonathan Slenders <jonathan@slenders.be> | 2018-05-24 22:38:28 +0200 |
---|---|---|
committer | Jonathan Slenders <jonathan@slenders.be> | 2018-05-24 22:38:28 +0200 |
commit | e9cff3a3765861397b595f8425efa8c109a73b1f (patch) | |
tree | ed8ae4ead9b6c86ba002e7c729af514014fa01a4 | |
parent | cb4942775149c738c876cc934dddcc2e1c605031 (diff) |
Little improvements in SQLite tutorial.
-rw-r--r-- | docs/pages/tutorials/repl.rst | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/docs/pages/tutorials/repl.rst b/docs/pages/tutorials/repl.rst index 7d7bba13..3f1b905a 100644 --- a/docs/pages/tutorials/repl.rst +++ b/docs/pages/tutorials/repl.rst @@ -120,16 +120,17 @@ wrapped into a :class:`~prompt_toolkit.lexers.PygmentsLexer`. Auto-completion --------------- -Now we are going to add auto completion. We'd like a drop down menu of -`possible keywords <https://www.sqlite.org/lang_keywords.html>`_ when the user -is typing. +Now we are going to add auto completion. We'd like to display a drop down menu +of `possible keywords <https://www.sqlite.org/lang_keywords.html>`_ when the +user starts typing. -Create your ``sql_completer`` instance from the ``WordCompleter`` class -defining a set of ``keywords`` for auto-completion. +We can do this by creating an `sql_completer` object from the +:class:`~prompt_toolkit.completion.WordCompleter` class, defining a set of +`keywords` for the auto-completion. Like the lexer, this ``sql_completer`` instance can be passed to either the :class:`~prompt_toolkit.shortcuts.PromptSession` class or the -:meth:`~prompt_toolkit.shortcuts.PromptSession.prompt` method +:meth:`~prompt_toolkit.shortcuts.PromptSession.prompt` method. .. code:: python @@ -181,7 +182,7 @@ Like the lexer, this ``sql_completer`` instance can be passed to either the .. image:: ../../images/repl/sqlite-4.png In about 30 lines of code we got ourselves an auto completing, syntax -highlighting REPL. Let's make it better. +highlighting REPL. Let's make it even better. Styling the menus |