docs: update examples + readme

This commit is contained in:
relikd
2022-12-20 01:26:17 +01:00
parent 85df707d63
commit f32046dffb
10 changed files with 124 additions and 53 deletions

View File

@@ -11,9 +11,17 @@ class SimpleGroupByPlugin(Plugin):
'root': '/blog',
'slug': 'simple/{key}/index.html',
'template': 'example-simple.html',
'key_obj_fn': 'X.upper() if X else "empty"',
'replace_none_key': 'unknown',
})
watcher.config.set_key_map({'Foo': 'bar'})
watcher.config.set_fields({'date': datetime.now()})
watcher.config.set_order_by('-title,body')
watcher.config.set_pagination(
enabled=True,
per_page=1,
url_suffix='p',
)
@watcher.grouping(flatten=True)
def fn_simple(args: GroupByCallbackArgs) -> Iterator[Tuple[str, dict]]: