Org-mode mailing list
 help / color / mirror / Atom feed
* buggy plantuml function
@ 2020-11-15 12:27 Immanuel Litzroth
       [not found] ` <5d8d7ed3-5d6a-d24a-f569-2933604ec657@gmx.at>
  0 siblings, 1 reply; 3+ messages in thread
From: Immanuel Litzroth @ 2020-11-15 12:27 UTC (permalink / raw)
  To: emacs-orgmode

(defun org-babel-plantuml-make-body (body params)
  "Return PlantUML input string.

BODY is the content of the source block and PARAMS is a property list
of source block parameters.  This function relies on the
`org-babel-expand-body:generic' function to extract `:var' entries
from PARAMS and on the `org-babel-variable-assignments:plantuml'
function to convert variables to PlantUML assignments.

If BODY does not contain @startXXX ... @endXXX clauses, @startuml
... @enduml will be added."
  (let ((assignments (org-babel-variable-assignments:plantuml params)))
    (if (string-prefix-p "@start" body t) assignments
      (format "@startuml\n%s\n@enduml"
      (org-babel-expand-body:generic body params assignments)))))

expands to assignments if the body starts with @startmindmap?
Immanuel
-- 
-- Researching the dual problem of finding the function that has a
given point as fixpoint.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: buggy plantuml function
       [not found] ` <5d8d7ed3-5d6a-d24a-f569-2933604ec657@gmx.at>
@ 2020-11-23 11:32   ` Immanuel Litzroth
  2020-11-23 13:19     ` Heinz Tuechler
  0 siblings, 1 reply; 3+ messages in thread
From: Immanuel Litzroth @ 2020-11-23 11:32 UTC (permalink / raw)
  To: Heinz Tuechler, emacs-orgmode

There is a solution in all source blocks that would have a problem because there
is a * at the beginning of a line. Just prepend it with ,.
So this works over here:
#+BEGIN_SRC plantuml :file test.png
@startmindmap
,* Debian
,** Ubuntu
,*** Linux Mint
,*** Kubuntu
,*** Lubuntu
,*** KDE Neon
,** LMDE
,** SolydXK
,** SteamOS
,** Raspbian with a very long name
,*** <s>Raspmbc</s> => OSMC
,*** <s>Raspyfi</s> => Volumio
@endmind
#+END_SRC

Of course I also had to change  org-babel-plantuml-make-body
 (defun org-babel-plantuml-make-body (body _)
                   body)
to make that work with "C-c C-c".
Weren't there supposed to be maintainers for this stuff? Has no plantuml
maintainer been found?
Immanuel



On Mon, Nov 23, 2020 at 11:28 AM Heinz Tuechler <tuechler@gmx.at> wrote:
>
> Immanuel Litzroth wrote/hat geschrieben on/am 15.11.2020 13:27:
> > (defun org-babel-plantuml-make-body (body params)
> >   "Return PlantUML input string.
> >
> > BODY is the content of the source block and PARAMS is a property list
> > of source block parameters.  This function relies on the
> > `org-babel-expand-body:generic' function to extract `:var' entries
> > from PARAMS and on the `org-babel-variable-assignments:plantuml'
> > function to convert variables to PlantUML assignments.
> >
> > If BODY does not contain @startXXX ... @endXXX clauses, @startuml
> > ... @enduml will be added."
> >   (let ((assignments (org-babel-variable-assignments:plantuml params)))
> >     (if (string-prefix-p "@start" body t) assignments
> >       (format "@startuml\n%s\n@enduml"
> >       (org-babel-expand-body:generic body params assignments)))))
> >
> > expands to assignments if the body starts with @startmindmap?
> > Immanuel
> >
>
> Dear Immanuel,
>
> did you ever receive an answer to your post? I ask, because I am
> curious, if you were able to use mindmap in a #+BEGIN_SRC plantuml /
> #+END_SRC block? For me it was not possible with *, because they get
> interpreted as org headlines and break the SRC block.
>
> best regards,
>
> Heinz
>


-- 
-- Researching the dual problem of finding the function that has a
given point as fixpoint.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: buggy plantuml function
  2020-11-23 11:32   ` Immanuel Litzroth
@ 2020-11-23 13:19     ` Heinz Tuechler
  0 siblings, 0 replies; 3+ messages in thread
From: Heinz Tuechler @ 2020-11-23 13:19 UTC (permalink / raw)
  To: emacs-orgmode

see inline
Immanuel Litzroth wrote/hat geschrieben on/am 23.11.2020 12:32:
> There is a solution in all source blocks that would have a problem because there
> is a * at the beginning of a line. Just prepend it with ,.
> So this works over here:
> #+BEGIN_SRC plantuml :file test.png
> @startmindmap
> ,* Debian
> ,** Ubuntu
> ,*** Linux Mint
> ,*** Kubuntu
> ,*** Lubuntu
> ,*** KDE Neon
> ,** LMDE
> ,** SolydXK
> ,** SteamOS
> ,** Raspbian with a very long name
> ,*** <s>Raspmbc</s> => OSMC
> ,*** <s>Raspyfi</s> => Volumio
> @endmind
> #+END_SRC
>
> Of course I also had to change  org-babel-plantuml-make-body
>  (defun org-babel-plantuml-make-body (body _)
>                    body)
> to make that work with "C-c C-c".
> Weren't there supposed to be maintainers for this stuff? Has no plantuml
> maintainer been found?
> Immanuel
>
Thank you for this very useful hint. I had no idea, how to search for
that solution.
Regarding your change of org-babel-plantuml-make-body, I don't know what
you mean. Your example works for me without any change I would be aware of.
Heinz

>
>
> On Mon, Nov 23, 2020 at 11:28 AM Heinz Tuechler <tuechler@gmx.at> wrote:
>>
>> Immanuel Litzroth wrote/hat geschrieben on/am 15.11.2020 13:27:
>>> (defun org-babel-plantuml-make-body (body params)
>>>   "Return PlantUML input string.
>>>
>>> BODY is the content of the source block and PARAMS is a property list
>>> of source block parameters.  This function relies on the
>>> `org-babel-expand-body:generic' function to extract `:var' entries
>>> from PARAMS and on the `org-babel-variable-assignments:plantuml'
>>> function to convert variables to PlantUML assignments.
>>>
>>> If BODY does not contain @startXXX ... @endXXX clauses, @startuml
>>> ... @enduml will be added."
>>>   (let ((assignments (org-babel-variable-assignments:plantuml params)))
>>>     (if (string-prefix-p "@start" body t) assignments
>>>       (format "@startuml\n%s\n@enduml"
>>>       (org-babel-expand-body:generic body params assignments)))))
>>>
>>> expands to assignments if the body starts with @startmindmap?
>>> Immanuel
>>>
>>
>> Dear Immanuel,
>>
>> did you ever receive an answer to your post? I ask, because I am
>> curious, if you were able to use mindmap in a #+BEGIN_SRC plantuml /
>> #+END_SRC block? For me it was not possible with *, because they get
>> interpreted as org headlines and break the SRC block.
>>
>> best regards,
>>
>> Heinz
>>
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-23 13:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-15 12:27 buggy plantuml function Immanuel Litzroth
     [not found] ` <5d8d7ed3-5d6a-d24a-f569-2933604ec657@gmx.at>
2020-11-23 11:32   ` Immanuel Litzroth
2020-11-23 13:19     ` Heinz Tuechler

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git