Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
297c8683
Commit
297c8683
authored
Nov 28, 2016
by
Achilleas Pipinellis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add guidelines in doc linking with HAML
[ci skip]
parent
c5482796
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
doc/development/doc_styleguide.md
doc/development/doc_styleguide.md
+71
-0
No files found.
doc/development/doc_styleguide.md
View file @
297c8683
...
...
@@ -113,6 +113,77 @@ merge request.
add an alternative text:
`[identifier]: https://example.com "Alternative text"`
that appears when hovering your mouse on a link
### Linking to inline docs
Sometimes it's needed to link to the built-in documentation that GitLab provides
under
`/help`
. This is normally done in files inside the
`app/views/`
directory
with the help of the
`help_page_path`
helper method.
In its simplest form, the HAML code to generate a link to the
`/help`
page is:
```
haml
=
link_to
'Help page'
,
help_page_path
(
'user/permissions'
)
```
The
`help_page_path`
contains the path to the document you want to link to with
the following conventions:
-
it is relative to the
`doc/`
directory in the GitLab repository
-
the
`.md`
extension must be omitted
-
it must not end with a slash (
`/`
)
Below are some special cases where should be used depending on the context.
You can combine one or more of the following:
1.
**Linking to an anchor link.**
Use
`anchor`
as part of the
`help_page_path`
method:
```haml
= link_to 'Help page', help_page_path('user/permissions', anchor: 'anchor-link')
```
1.
**Opening links in a new tab.**
This should be the default behavior:
```haml
= link_to 'Help page', help_page_path('user/permissions'), target: '_blank'
```
1.
**Linking to a circle icon.**
Usually used in settings where a long
description cannot be used, like near checkboxes. You can basically use
any font awesome icon, but prefer the
`question-circle`
:
```haml
= link_to icon('question-circle'), help_page_path('user/permissions')
```
1.
**Using a button link.**
Useful in places where text would be out of context
with the rest of the page layout:
```haml
= link_to 'Help page', help_page_path('user/permissions'), class: 'btn btn-info'
```
1.
**Underlining a link.**
```haml
= link_to 'Help page', help_page_path('user/permissions'), class: 'underlined-link'
```
1.
**Using links inline of some text.**
```haml
Description to #{link_to 'Help page', help_page_path('user/permissions')}.
```
1.
**Adding a period at the end of the sentence.**
Useful when you don't want
the period to be part of the link:
```haml
= succeed '.' do
Learn more in the
= link_to 'Help page', help_page_path('user/permissions')
```
## Images
-
Place images in a separate directory named
`img/`
in the same directory where
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment