diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2019-05-21 02:23:50 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2019-05-21 02:23:50 +0300 |
commit | b09ee838e77695c5b577271666a490e2412b0afd (patch) | |
tree | 1d514109c5523ea169d90cecee8ee2e97a34ef88 /README.md | |
parent | 09387629a7bab10f5b4085ea3a45b426e67c6de5 (diff) |
Add option to link to Web IDE to edit files
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -346,6 +346,17 @@ The links pointing to the files should be similar to: Nanoc will then build and render those links correctly according with what's defined in [`Rules`](/Rules). +## Linking to source files + +A helper called [`edit_on_gitlab`](/lib/helpers/edit_on_gitlab.rb) can be used +to link to a page's source file. We can link to both the simple editor and the +web IDE. Here's how you can use it in a Nanoc layout: + +- Default editor: `<a href="<%= edit_on_gitlab(@item, editor: :simple) %>">Simple editor</a>` +- Web IDE: `<a href="<%= edit_on_gitlab(@item, editor: :webide) %>">Web IDE</a>` + +If you don't specify `editor:`, the simple one is used by default. + ## Review Apps for documentation merge requests If you are contributing to GitLab docs read how to [create a Review App with each |