On Sunday, February 12, 2017 at 6:31:10 PM UTC-6, Edward K. Ream wrote:
> Let's make the demo script *entirely descriptive...*
Done at 906dd60. Attached is Leo's first ever slide created descriptively.
And here is the demo script that created it:
demo.set_top_size(height=500, width=800)
table = (
(True, None, '<-- @file node', '@file leoApp.py'),
(True, None, '<-- @test node', '@test init method'),
(False, 2, '<-- icon box', '@suite plugins syntax'),
)
for arrow, offset, label, headline in table:
demo.Head(arrow, label, headline, offset=offset)
body, tree, log = 'body', 'tree', 'log'
geom = demo.pane_geometry('body')
table = (
(body, 'The Minibuffer (below)', 'center', geom.height()-25),
(body, 'The Body Pane', 0, 0),
(tree, 'The Outline Pane', 200, 200),
(log, 'The Log Pane', 0, 0),
)
for pane, h, x, y in table:
if x and y:
Callout(h, pane=pane, position=(x,y))
else:
Callout(h, pane=pane)
fn = demo.get_icon_fn('box01.png')
w = Image(fn, position=(20, 30), magnification=2)
Callout('<-- An Icon',position=(20+w.width(), w.y()-3))
###
demo.next()
As you can see, there are very few "magic" constants in this script. More
importantly, the script will remain valid even if the outline being
annotated changes. This should eliminate most of the extreme drudgery
associated with post production, thereby encouraging continual improvement
of slides.
Descriptive creation of graphics is nothing new in the world. It was one of
Adobe's key innovations, decades ago now. Still, this is an important
milestone for Leo's docs.
Edward
P.S. I continue to improve the Demo class, thereby simplifying demo scripts
and making them even more descriptive. For example, this code is clumsy:
if x and y:
Callout(h, pane=pane, position=(x,y))
else:
Callout(h, pane=pane)
Instead, (None, None) should be a valid (do-nothing) position, so that the
code above can become:
Callout(h, pane=pane, position=(x,y))
EKR
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.