emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Add preamble support to ob-plantuml.el


From: Thibault Marin
Subject: Re: [O] Add preamble support to ob-plantuml.el
Date: Tue, 06 Dec 2016 19:39:01 -0600
User-agent: mu4e 0.9.16; emacs 24.5.1

Thanks for the feedback.


>> What about using noweb syntax then?
>
> Or prologue?

I didn't know about the prologue header.  This is exactly what I need
(it seems to be more convenient than the noweb approach).

However, ob-plantuml does not seem to support the prologue option.  So I
am modifying my patch to add support for the :prologue and :epilogue
header arguments instead of using a new customization variable.  In the
process, I have added support for header variables which are passed to
the PlantUML file via the !define macro.  I am also adding a test file
which checks that the temporary file passed to the plantuml program is
properly generated (it does not run or check the output of plantuml).

Please let me know you have any comment on the patch.  Thanks in
advance.

I have a slightly tangential question about handling of list variables.

Considering the following org content:

#+BEGIN_SRC org
,#+name: variable_values
| CLASSNAME | test_class |
| PROPERTY  | test_prop  |

,#+header: :file tmp.puml
,#+header: :var x=variable_values
,#+begin_src plantuml
class CLASSNAME {
+PROPERTY
}
,#+end_src"
#+END_SRC

would it make sense to resolve to the following output:

#+BEGIN_SRC plantuml
@startuml
!define CLASSNAME test_class
!define PROPERTY test_prop
class CLASSNAME {
+PROPERTY
}
@enduml
#+END_SRC
?

On the first hand, this doesn't make much sense because the =x= variable is
never actually defined in the source block, but for languages that don't handle
array variables, that would allow the user to define multiple variables at once
(I first thought about this when looking at ob-css, where I wanted to (1) use
header variables and (2) group them in a single org-table).  What do you think?

Best,
thibault

Attachment: 0001-ob-plantuml.el-Add-support-for-prologue-and-header-v.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]