Commit Graph

22 Commits

Author SHA1 Message Date
Guillaume Grossetie 0cba81c0ec Enable section anchors 2019-07-16 12:53:38 +02:00
Guillaume Grossetie 5854537f11 Enable AsciiDoc syntax highlighting (using Rouge) 2019-07-02 09:24:05 +02:00
Guillaume Grossetie 3f5d7c7e1c Add basic support for AsciiDoc include directive
See http://asciidoctor.org/docs/user-manual/#include-directive
2019-06-14 07:53:08 +00:00
gfyoung c858f70d07 Enable frozen string for lib/gitlab/*.rb 2018-10-22 07:00:50 +00:00
Turo Soisenniemi 9a450aedc2 Set Asciidoctor outfilesuffix to default .adoc
Without setting outfilesuffix Asciidoctor defaults to .html. When .html is used,
inter-document cross references do not work in Gitlab's repository / file renderer.
See more information from
http://asciidoctor.org/docs/user-manual/#navigating-between-source-files
and
http://asciidoctor.org/docs/user-manual/#inter-document-cross-references
2018-02-14 20:40:47 +00:00
Mario de la Ossa eaada9d706 use Gitlab::UserSettings directly as a singleton instead of including/extending it 2018-02-02 18:39:55 +00:00
Sean McGivern 5883ce95ef `current_application_settings` belongs on `Gitlab::CurrentSettings`
The initializers including this were doing so at the top level, so every object
loaded after them had a `current_application_settings` method. However, if
someone had rack-attack enabled (which was loaded before these initializers), it
would try to load the API, and fail, because `Gitlab::CurrentSettings` didn't
have that method.

To fix this:

1. Don't include `Gitlab::CurrentSettings` at the top level. We do not need
   `Object.new.current_application_settings` to work.
2. Make `Gitlab::CurrentSettings` explicitly `extend self`, as we already use it
   like that in several places.
3. Change the initializers to use that new form.
2017-08-31 13:38:33 +01:00
Jarka Kadlecova 3ca9328443 Fix LaTeX formatting for AsciiDoc wiki 2017-05-24 15:47:35 +02:00
Robert Speicher 99996b6bc7 Merge branch 'bvl-security-9-1-markup-pipeline'
(security-9-1) Render asciidoc & other markup using banzai in a pipeline

See merge request !2098
2017-05-10 16:44:20 +02:00
Toon Claes ed6ed251af Remove unused optional parameter `asciidoc_opts` 2017-04-27 13:22:17 +02:00
Douwe Maan 4f2d6b3e21 Refactor MarkupHelper 2017-04-27 13:22:17 +02:00
Toon Claes 05e0f50453 Cache the rendered README, but post-process on show
Because the post-processing of the rendered README is dependent on the
context (i.e. the current user), do the post-processing when the
README is being displayed.
2017-04-27 13:22:17 +02:00
Robert Speicher 33c8d413d2 Merge branch 'asciidoctor-xss-patch' into 'security'
Add sanitization filter to asciidocs output to prevent XSS

See https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2057
2017-02-15 10:41:40 -05:00
Horacio Sanson f986b4c4e5 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
2017-01-12 10:04:52 +00:00
Munken de0dfb10d4 Don't open Asciidoc module twice 2016-12-15 18:03:57 +00:00
Munken 2d170a20dc Render math in Asciidoc and Markdown with KaTeX using code blocks 2016-12-14 16:50:54 +00:00
Horacio Sanson f4f9af06c9 Enable display of admonition icons in Asciidoc.
When rendering Asciidoc documents this merge request enables the diplay of
admonition blocks using font icons. This improves the looks of Asciidoc redered
files.

This uses the font-awesome fonts already present in Gitlab so no large
dependencies are required for this to work.
2016-12-08 08:46:22 +09:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Ben Boeckel e919b5a4e9 Fix relative links in other markup formats
- Apply the RelativeLinkFilter filter to other formats, e.g.,
  reStructuredText so links from the Files view or the Project view work
- Remove the AsciidocPipeline pipeline

Fixes #3533.
2016-02-12 17:20:59 +01:00
Douwe Maan 7781bda9bd Move Markdown/reference logic from Gitlab::Markdown to Banzai 2015-12-15 15:51:16 +01:00
Douwe Maan b093cb35d1 Use Gitlab::Markdown for Asciidoc and ReferenceExtractor pipelines 2015-10-14 20:18:49 +02:00
Jakub Jirutka 8dbc4746fe Handle AsciiDoc better, reuse HTML pipeline filters (fixes #9263) 2015-05-18 20:48:03 +02:00