sphinx-contrib / plantuml

BSD 2-Clause "Simplified" License
113 stars 40 forks source link

Error integrating timing diagram in sphinx #78

Open christian-herber-nxp opened 1 year ago

christian-herber-nxp commented 1 year ago

Given the following example (based on https://plantuml.com/en/timing-diagram):

.. uml::

  clock   "Clock_0"   as C0 with period 50
  clock   "Clock_1"   as C1 with period 50 pulse 15 offset 10
  binary  "Binary"  as B
  concise "Concise" as C
  robust  "Robust"  as R
  analog  "Analog"  as A

  @0
  C is Idle
  R is Idle
  A is 0

  @100
  B is high
  C is Waiting
  R is Processing
  A is 3

  @300
  R is Waiting
  A is 1

sphinx/plantuml is failing to create the diagram. The resulting message is

WARNING: error while running plantuml

b'ERROR\n1\nSyntax Error?\nSome diagram description contains errors\n'

Simpler diagrams work, e.g.

.. uml::

  robust "Web Browser" as WB
  concise "Web User" as WU

  @0
  WU is Idle
  WB is Idle

  @100
  WU is Waiting
  WB is Processing

  @300
  WB is Waiting

is a working example. Where does this fall apart? Hopefully something that can be fixed.

rhempel commented 8 months ago

From my own experiments, the timing diagram plugin can handle simple clock statements like this:

clock Clock_0 with period 50

but adding some modifiers like offset or as fails

On my Ubuntu box, the most recent version of plantuml package is 1.2020.2 - which is a bit silly

rhempel commented 8 months ago

I have just removed the out of date Ubuntu provided package for plantuml, and installed the default-jre packeage. Then manually downloaded the latest pre-compiled plantuml jar file and pointed Sphinx at that file.

The example now builds correctly - recommend this issue be closed with a note to update to the latest PlantUML ;-)