Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Developer Documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
brienne
Developer Documentation
Commits
9c99b6bb
Commit
9c99b6bb
authored
8 years ago
by
Sean Madsen
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #66 from seanmadsen/attr_list
custom header IDs
parents
cb094e50
8301023d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/markdownrules.md
+40
-3
40 additions, 3 deletions
docs/markdownrules.md
mkdocs.yml
+1
-0
1 addition, 0 deletions
mkdocs.yml
with
41 additions
and
3 deletions
docs/markdownrules.md
+
40
−
3
View file @
9c99b6bb
...
...
@@ -105,10 +105,37 @@ Heading 2
---------
```
***Convention:***
Each page should have one and only one
*Heading 1*
,
which should be at the top of the page as a page title. Other headings within
page content should be level 2 or greater.
### Heading IDs
Heading IDs allow you to link to specific sections in a page by appending
the heading ID to the page URL. Most markdown platforms (e.g. MkDocs, GitHub)
automatically set a heading ID for every heading and do so using the text of
the heading itself. Sticking with the default is great is most cases, however
sometimes you want to override it. Some markdown platforms (e.g. MkDocs)
allow you to set
*custom*
heading IDs to override the automatically chosen
value.
Setting a custom ID:
```
md
## How to foo a bar {:#foo}
```
This is helpful when you think that readers are likely to frequently link
to this section in the future.
*
Custom heading IDs will remain the same (thus preserving incoming links) even
after the text of the heading is edited.
*
Custom heading IDs create shorter URLs.
Custom heading IDs only work in MkDocs when the following code is used to enable
the
[
Attribute Lists
](
https://pythonhosted.org/Markdown/extensions/attr_list.html
)
extension:
```
yml
markdown_extensions
:
-
markdown.extensions.attr_list
```
## Lists
...
...
@@ -320,6 +347,16 @@ Add a custom title (make sure to quote the title):
Stand back. I'm about to try science!
```
### Enabling
Admonitions only work in MkDocs when the following code is used to enable
the
[
Admonition extension
](
https://pythonhosted.org/Markdown/extensions/admonition.html
)
:
```
yml
markdown_extensions
:
-
markdown.extensions.admonition
```
## Images
Images function mostly the same as hyperlinks, but preceded by an exclamation
...
...
This diff is collapsed.
Click to expand it.
mkdocs.yml
+
1
−
0
View file @
9c99b6bb
...
...
@@ -7,6 +7,7 @@ extra_javascript:
-
js/custom.js
markdown_extensions
:
-
markdown.extensions.admonition
-
markdown.extensions.attr_list
pages
:
-
Home
:
index.md
-
Basics
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment