Friday, June 4, 2021¶
review the quicklink api for dashboard¶
This was yet another avalanche of long-awaited code cleanup.
This change in the quicklink definition API was needed because the new DashboardLayouts need a static list of the quicklinks, i.e. which does not depend on the user type. Only when rendering them, Lino checks for view permission. Because the new Dashboard is an actor, and the Site’s quicklinks are in the toolbar of this actor.
New property Site.quicklinks
.
New method Site.get_quicklink_items()
.
Methods Site.setup_quicklinks()
and Site.get_quicklinks()
have a
changed API.
Also Plugin.get_quicklinks()
and Plugin.setup_quicklinks()
.
List of the touched repositories:
Project |
Status |
URL |
lino |
master! |
|
xl |
master! |
|
noi |
master! |
|
avanti |
master! |
|
book |
master! |
|
welfare |
master! |
|
welcht |
master! |
|
presto |
master! |
|
shop |
master! |
|
amici |
master! |
|
algus |
master! |
|
blog |
master! |
Upgrade to Sphinx 4¶
In eid I had the following problem:
Extension error (sphinx.ext.extlinks):
Handler <function setup_link_roles at 0x7f381b1c1048> for event 'builder-inited' threw an exception (exception: 'NoneType' object has no attribute 'replace')
This was because rstgen.sphinxconf.default_conf
didn’t test for an empty
srcref_url_template()
. Now it does:
if prj.main_package:
root_mod, tpl = srcref_url_template(prj.main_package)
if tpl:
extlinks.update(srcref=(tpl, ''))
A second problem was this:
from sphinx.roles import menusel_role
ImportError: cannot import name 'menusel_role'
from sphinx.roles import MenuSelection as menusel_role
ImportError: cannot import name 'menusel_role'
A third problem was in Lino Welfare:
docs/specs/plugins.rst:5: WARNING: duplicated entry found in toctree: specs/clients