cms1
-- a content management systemΒΆ
A demo project showing a Lino CMS.
>>> from lino import startup
>>> startup('lino_book.projects.cms1.settings')
>>> from lino.api.doctest import *
>>> mp = settings.SITE.plugins.memo.parser
>>> print(mp.parse("[upload 1] Some text."))
<a href="/admin/#/api/uploads/Uploads/1" target="_blank"/><img src="/media/uploads/2022/09/MurderontheOrientExpress.jpg" style="padding:4px; height:10em" title="Murder on the orient express cover"/></a> Some text.
>>> print(mp.parse("[upload 1 My caption] Some text."))
<a href="/admin/#/api/uploads/Uploads/1" target="_blank"/><img src="/media/uploads/2022/09/MurderontheOrientExpress.jpg" style="padding:4px; height:10em" title="My caption"/></a> Some text.
>>> print(mp.parse("[upload 1 thumb|My caption] Some text."))
<a href="/admin/#/api/uploads/Uploads/1" target="_blank"/><img src="/media/uploads/2022/09/MurderontheOrientExpress.jpg" style="padding:4px; height:10em" title="My caption"/></a> Some text.
>>> print(mp.parse("[upload 1 thumb|right|My caption] Some text."))
[ERROR Invalid format name 'right' (allowed names are (None, 'thumb', 'tiny', 'wide', 'duo', 'trio')). in '[upload 1 thumb|right|My caption]' at position 0-33] Some text.
>>> print(mp.parse("[upload 1 right|thumb|My caption] Some text."))
<a href="/admin/#/api/uploads/Uploads/1" target="_blank"/><img src="/media/uploads/2022/09/MurderontheOrientExpress.jpg" style="padding:4px; float:right; height:10em" title="My caption"/></a> Some text.
>>> print(mp.parse("[upload 1 right|thumb|] Some text."))
<a href="/admin/#/api/uploads/Uploads/1" target="_blank"/><img src="/media/uploads/2022/09/MurderontheOrientExpress.jpg" style="padding:4px; float:right; height:10em" title="Murder on the orient express cover"/></a> Some text.