diff options
author | Horacio Sanson <horacio@allm.net> | 2016-11-29 02:41:29 +0900 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-01-12 10:04:52 +0000 |
commit | f986b4c4e529f4c2518f0ce37dc9dfcaa2f073a0 (patch) | |
tree | 13e60d8ed5cb64be9399516882e8d8e73efffbc8 /lib/api | |
parent | 826adaaff876d2b6b5886e6d8133b0d0c2cd4a2d (diff) | |
download | gitlab-ce-f986b4c4e529f4c2518f0ce37dc9dfcaa2f073a0.tar.gz |
Add support for PlantUML diagrams in Asciidoc.
This MR enables rendering of PlantUML diagrams in Asciidoc documents. To add a
PlantUML diagram all we need is to include a plantuml block like:
```
[plantuml, id="myDiagram", width="100px", height="100px"]
--
bob -> alice : ping
alice -> bob : pong
--
```
The plantuml block is substituted by an HTML img element with *src* pointing to
an external PlantUML server.
This MR also add a PlantUML integration section to the Administrator -> Settings
page to configure the PlantUML rendering service and to enable/disable it.
Closes: #17603
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/entities.rb | 2 | ||||
-rw-r--r-- | lib/api/settings.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index d2fadf6a3d0..885ce7d44bc 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -565,6 +565,8 @@ module API expose :repository_storages expose :koding_enabled expose :koding_url + expose :plantuml_enabled + expose :plantuml_url end class Release < Grape::Entity diff --git a/lib/api/settings.rb b/lib/api/settings.rb index 9eb9a105bde..c5eff16a5de 100644 --- a/lib/api/settings.rb +++ b/lib/api/settings.rb @@ -93,6 +93,10 @@ module API given koding_enabled: ->(val) { val } do requires :koding_url, type: String, desc: 'The Koding team URL' end + optional :plantuml_enabled, type: Boolean, desc: 'Enable PlantUML' + given plantuml_enabled: ->(val) { val } do + requires :plantuml_url, type: String, desc: 'The PlantUML server URL' + end optional :version_check_enabled, type: Boolean, desc: 'Let GitLab inform you when an update is available.' optional :email_author_in_body, type: Boolean, desc: 'Some email servers do not support overriding the email sender name. Enable this option to include the name of the author of the issue, merge request or comment in the email body instead.' optional :html_emails_enabled, type: Boolean, desc: 'By default GitLab sends emails in HTML and plain text formats so mail clients can choose what format to use. Disable this option if you only want to send emails in plain text format.' @@ -114,7 +118,7 @@ module API :shared_runners_enabled, :max_artifacts_size, :container_registry_token_expire_delay, :metrics_enabled, :sidekiq_throttling_enabled, :recaptcha_enabled, :akismet_enabled, :admin_notification_email, :sentry_enabled, - :repository_storage, :repository_checks_enabled, :koding_enabled, + :repository_storage, :repository_checks_enabled, :koding_enabled, :plantuml_enabled, :version_check_enabled, :email_author_in_body, :html_emails_enabled, :housekeeping_enabled end |