Discourse yUML

discourse-yuml adds yUML support to discourse.

From the readme


discourse-yuml

Add the ability to write yUML class diagrams directly into a discourse post.

Installation

Docker

To install in docker, add the following to your app.yml in the plugins section:

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/sekhat/discourse-yuml.git

and rebuild docker via

cd /var/discourse
./launcher rebuild app

Manual

From your main discourse do:

cd plugins
git clone https://github.com/sekhat/discourse-yuml.git
cd ..

Limitations

Currently, it only supports yUML class diagrams.

Usage

A yUML diagram can be specified as so

[yuml]
[Class] -> [AnotherClass]
[/yuml]

Which should give you a diagram like so

16 Likes

I’ve now updated this to work with the latest versions of Discourse.

Sorry it’s taken so long for anybody using it.

7 Likes

Is it possible to have multiple yUML diagrams per post? I seem to be only able to get a single YUML diagram per post to work.

PS. love the plugin :slight_smile:

How to config link of pictures diagrams in post use to https only?

Because it makes my links not work.

I try config to discourse-yuml.js.es6 at “var uri = “http://yuml.me/diagram/scruffy/class/”” is “var uri = “https://yuml.me/diagram/scruffy/class/”” It does not work

But i open link at my post it is https

At the moment there’s no such configuration.

Immediate quick fix patch to get you up and running:

You can change the source code for the plugin directly to change the link to https, Which the line you want to change is line 9 of assets/javascripts/lib/discourse-markdown/discourse-yuml.js.es6 github link.

Of course this means it isn’t really configurable, but it’ll get you up and running.

Longer term

On top of that, If you are pretty comfortable with writing discourse plugins, you can add a configuration option yourself, that alters the url and submit a pull request. That’ll always be muchly appreciated.

Though, If you aren’t comfortable doing that, you can open an issue in the github project, and I’ll get round to making it configurable option once I’ve got some spare time.

1 Like

Sorry, I’ve only just spotted this. Latest update now allows you to have multiple diagrams per post. It was something I spotted myself, and fixed it a few weeks ago.

1 Like

Now my website. Can not show drigram :sweat:

I assume you just went and changed line 9?

Can you post the modified code? Just so I can double check it?

Yes i tried, Not change to https://
And now diagram not show.

It likely broke due to the new Commonmark Engine.

You changed the code but the link didn’t change to https? Have you tried force refreshing the page. I don’t think the plugin code would get cached by the browser, but it might be.

1 Like

When did this change? as I’m running an up to date discourse, though not over https (as it’s an internal network) and the plugin still works for me.

Are you following tests-passed? As it happened this week, the new markdown engine, CommonMark, was set as the default.

https://github.com/discourse/discourse/commit/d0c5205a52e850fe97313ed05c3e637792547841

I’m not sure. Will update the post or not

Now plugin not works my website.

In that case, just remove the plugin and reinstall it, if you can log an issue on the github project, and I’ll get round to adding a HTTPs option (or auto detect which would be best) when I get some time.

1.Case add https i know.
2.But the case a diagrams not show i tried remove the plugin and reinstall it old problem diagrams not show

Log issues for both at github, and supply me with your version of discourse and I’ll try to replicate and fix.

1 Like

Version 0.2.0 released:

Now supports the new Markdown-It engine.
All Image URL’s are to the https endpoint for yuml.me

Caveats:

  • No backwards compatability with the old engine. Do not upgrade unless you are on a version of Discourse using Markdown-It

Don’t forget to rebake your posts rake posts:rebake

4 Likes

Cheers for pointing that out for me. :slight_smile:

2 Likes