Search bar offers the following options:
Term presence. The below example searches for documents that
must contain “foo”, might contain “bar” and must not contain “baz”:
+foo bar -baz
Wildcards. The below example searches for documents with words beginning with “foo”:
Search in specific fields. The following search matches all objects
in "twisted.mail" that matches “search”:
Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.
Fuzzy matches. The following search matches all documents
that have a word within 1 edit distance of “foo”:
Results provided by Lunr.js
Character attribute manipulation API.
This module provides a domain-specific language (using Python syntax) for the creation of text with additional display attributes associated with it. It is intended as an alternative to manually building up strings containing ECMA 48 character attribute control codes. It currently supports foreground and background colors (black, red, green, yellow, blue, magenta, cyan, and white), intensity selection, underlining, blinking and reverse video. Character set selection support is planned.
Character attributes are specified by using two Python operations: attribute lookup and indexing. For example, the string "Hello world" with red foreground and all other attributes set to their defaults, assuming the name twisted.conch.insults.text.attributes has been imported and bound to the name "A" (with the statement from twisted.conch.insults.text import attributes as A, for example) one uses this expression:
Other foreground colors are set by substituting their name for "red". To set both a foreground and a background color, this expression is used:
Note that either A.bg.green can be nested within A.fg.red or vice versa. Also note that multiple items can be nested within a single index operation by separating them with commas:
A.bg.green[A.fg.red["Hello"], " ", A.fg.blue["world"]]
Other character attributes are set in a similar fashion. To specify a blinking version of the previous expression:
A.blink[A.bg.green[A.fg.red["Hello"], " ", A.fg.blue["world"]]]
A.reverseVideo, A.underline, and A.bold are also valid.
A third operation is actually supported: unary negation. This turns off an attribute when an enclosing expression would otherwise have caused it to be on. For example:
A.underline[A.fg.red["Hello", -A.underline[" world"]]]
A formatting structure can then be serialized into a string containing the necessary VT102 control codes with
||Assemble formatted text from structured information.|
||Factory for character attributes, including foreground and background color and non-color attributes such as bold, reverse video and underline.|
Assemble formatted text from structured information.
Currently handled formatting includes: bold, blink, reverse, underline and color codes.
from twisted.conch.insults.text import attributes as A assembleFormattedText( A.normal[A.bold['Time: '], A.fg.lightRed['Now!']])
Would produce "Time: " in bold formatting, followed by "Now!" with a foreground color of light red and without any additional formatting.
|formatted||Structured text and attributes.|
|String containing VT102 control sequences that mimic those specified by formatted.|