Discourse-yuml: Add yUML diagrams to discourse posts


(Sekhat) #1

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


(Sekhat) #2

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

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


(Geoff Bowers) #3

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:


(Bank Live) #4

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


(Sekhat) #5

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.


(Sekhat) #6

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.


(Bank Live) #7

Now my website. Can not show drigram :sweat:


(Sekhat) #8

I assume you just went and changed line 9?

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


(Bank Live) #9

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


(cpradio) #10

It likely broke due to the new Commonmark Engine.


(Sekhat) #11

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.


(Sekhat) #12

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.


(cpradio) #13

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


(Bank Live) #14

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


(Bank Live) #15

Now plugin not works my website.


(Sekhat) #16

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.


(Bank Live) #17

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


(Sekhat) #18

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


(Sekhat) #19

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


(Sekhat) #20

Cheers for pointing that out for me. :slight_smile: