mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 13:29:47 +00:00
Minor doc updates, fixes and improvements
In particular, removed code which no longer worked, made light theme easier on the eyes, added slight syntax highlightning, and fixed search for exact matches.
This commit is contained in:
@@ -1,6 +1,19 @@
|
||||
import re
|
||||
|
||||
|
||||
def _fmt_strings(*dicts):
|
||||
for d in dicts:
|
||||
for k, v in d.items():
|
||||
if v in ('None', 'True', 'False'):
|
||||
d[k] = '<strong>{}</strong>'.format(v)
|
||||
else:
|
||||
d[k] = re.sub(
|
||||
r'([brf]?([\'"]).*\2)',
|
||||
lambda m: '<em>{}</em>'.format(m.group(1)),
|
||||
v
|
||||
)
|
||||
|
||||
|
||||
KNOWN_NAMED_EXAMPLES = {
|
||||
('message', 'string'): "'Hello there!'",
|
||||
('expires_at', 'date'): 'datetime.timedelta(minutes=5)',
|
||||
@@ -41,6 +54,8 @@ KNOWN_TYPED_EXAMPLES = {
|
||||
'InputPeer': "'username'"
|
||||
}
|
||||
|
||||
_fmt_strings(KNOWN_NAMED_EXAMPLES, KNOWN_TYPED_EXAMPLES)
|
||||
|
||||
SYNONYMS = {
|
||||
'InputUser': 'InputPeer',
|
||||
'InputChannel': 'InputPeer',
|
||||
|
Reference in New Issue
Block a user