demo-it icon indicating copy to clipboard operation
demo-it copied to clipboard

Automatic creation of demo-it steps from an org file

Open vv3 opened this issue 6 years ago • 2 comments

A feature request:

Given an org-file containing some headings and some source-code blocks containing named shell-commands, it should be possible to auto-generate the demo-it steps for presenting this org-file. Each heading becomes demo-it-presentation-advance and each code-block becomes demo-it-run-in-shell.

It is possible to handcraft the demo-it recipe, but it becomes cumbersome when editing the presentation and trying to keep the demo-it steps in sync.

It should be possible to parse the org-file using something like org-element-parse-buffer, and autogenerate the steps.

vv3 avatar Feb 14 '19 07:02 vv3

Interesting suggestion. Would you think that a function that generated the steps (which would allow you to add/change the steps) be a good idea?

On Feb 13, 2019, at 11:35 PM, Vegard Vesterheim [email protected] wrote:

A feature request:

Given an org-file containing some headings and some source-code blocks containing named shell-commands, it should be possible to auto-generate the demo-it steps for presenting this org-file. Each heading becomes demo-it-presentation-advance and each code-block becomes demo-it-run-in-shell.

It is possible to handcraft the demo-it recipe, but it becomes cumbersome when editing the presentation and trying to keep the demo-it steps in sync.

It should be possible to parse the org-file using something like org-element-parse-buffer, and autogenerate the steps.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/howardabrams/demo-it/issues/18, or mute the thread https://github.com/notifications/unsubscribe-auth/AAejjXdQthV3u8TbtpJZrDXns3H5B9THks5vNRHWgaJpZM4a7AIr.

howardabrams avatar Feb 15 '19 04:02 howardabrams

On Thu, 14 Feb 2019 20:29:02 -0800 Howard Abrams [email protected] wrote:

Interesting suggestion. Would you think that a function that generated the steps (which would allow you to add/change the steps) be a good idea?

Yes, that would be a really useful first step.

I have a org file containing some headings and some named sh source blocks. At the end of this org file I have manually created an emacs-lisp block which contains the 'demo-it-create' macro for presenting the same org file. Since my sh-source-blocks are named, I can refer to them in the demo-it steps file like this:

(demo-it-run-in-shell "<<dynamic_inventory>>")

This means that the demo-it-steps must be part of the self-same file which containts these named blocks. (But, according to the manual, org-mode is also able to call named blocks from other files, maybe this can be used to have the demo-it recipe in a separate file?)

Having a function that created this elisp-code which could then be edited manually afterwards would be useful.

--

  • Vegard V -

vv3 avatar Feb 15 '19 07:02 vv3