From f0b73f81198a9cba8961774f45e0b96f0cb73c78 Mon Sep 17 00:00:00 2001 From: Timothy Andrew Date: Tue, 31 May 2016 11:06:45 +0530 Subject: [PATCH 1/6] Add help document describing wiki linking behavior. --- app/views/projects/wikis/_form.html.haml | 2 + doc/markdown/markdown.md | 4 ++ doc/markdown/wiki.md | 77 ++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 doc/markdown/wiki.md diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index 797a1a59e9f7..893bea3c7590 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -20,6 +20,8 @@ .help-block To link to a (new) page, simply type %code [Link Title](page-slug) + \. More examples are in the + = link_to 'documentation', help_page_path(category: 'markdown', file: 'wiki', format: 'md') \. .form-group = f.label :commit_message, class: 'control-label' diff --git a/doc/markdown/markdown.md b/doc/markdown/markdown.md index c6c7ac81c0d0..e4101fa53888 100644 --- a/doc/markdown/markdown.md +++ b/doc/markdown/markdown.md @@ -28,6 +28,10 @@ * [Line Breaks](#line-breaks) * [Tables](#tables) +**[Wiki-Specific Markdown](wiki.md)** + +* [Links](wiki.md#links-to-other-wiki-pages) + **[References](#references)** ## GitLab Flavored Markdown (GFM) diff --git a/doc/markdown/wiki.md b/doc/markdown/wiki.md new file mode 100644 index 000000000000..b58107abea36 --- /dev/null +++ b/doc/markdown/wiki.md @@ -0,0 +1,77 @@ +# Wiki-Specific Markdown + +## Table of Contents + +* [Links to Other Wiki Pages](#links-to-other-wiki-pages) + * [Direct Page Link](#direct-page-link) + * [Direct File Link](#direct-file-link) + * [Hierarchical Link](#hierarchical-link) + * [Root Link](#root-link) + +## Links to Other Wiki Pages + +You can link to other pages on your wiki in a few different ways. + +### Direct Page Link + +A link which just includes the slug for a page will point to that page, _at the base level of the wiki_. + +1. This snippet would link to a `documentation` page at the root of your wiki. + +```markdown +[Link to Documentation](documentation) +``` + +### Direct File Link + +Links with a file extension point to that file, _relative to the current page_. + +1. If this snippet was placed on a page at `/documentation/related`, it would link to `/documentation/file.md`. + + ```markdown + [Link to File](file.md) + ``` + +### Hierarchical Link + +A link can be constructed relative to the current wiki page using `./`, `../`, etc. + +1. If this snippet was placed on a page at `/documentation/main`, it would link to `/documentation/related`. + + ```markdown + [Link to Related Page](./related) + ``` + +1. If this snippet was placed on a page at `/documentation/related/content`, it would link to `/documentation/main`. + + ```markdown + [Link to Related Page](../main) + ``` + +1. If this snippet was placed on a page at `/documentation/main`, it would link to `/documentation/related.md`. + + ```markdown + [Link to Related Page](./related.md) + ``` + +1. If this snippet was placed on a page at `/documentation/related/content`, it would link to `/documentation/main.md`. + + ```markdown + [Link to Related Page](../main.md) + ``` + +### Root Link + +A link starting with a `/` is relative to the wiki root, for non-file links. + +1. This snippet links to `/documentation` + + ```markdown + [Link to Related Page](/documentation) + ``` + +1. This snippet links to `/miscellaneous.md` + + ```markdown + [Link to Related Page](/miscellaneous.md) + ``` -- GitLab From d55e83addecda6c6a3632826b9bb61437d18290f Mon Sep 17 00:00:00 2001 From: Timothy Andrew Date: Tue, 31 May 2016 15:59:16 +0530 Subject: [PATCH 2/6] Use `succeed` to add periods to help text. --- app/views/projects/wikis/_form.html.haml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index 893bea3c7590..6360371804a1 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -18,11 +18,14 @@ .error-alert .help-block - To link to a (new) page, simply type - %code [Link Title](page-slug) - \. More examples are in the - = link_to 'documentation', help_page_path(category: 'markdown', file: 'wiki', format: 'md') - \. + = succeed '.' do + To link to a (new) page, simply type + %code [Link Title](page-slug) + + = succeed '.' do + More examples are in the + = link_to 'documentation', help_page_path(category: 'markdown', file: 'wiki', format: 'md') + .form-group = f.label :commit_message, class: 'control-label' .col-sm-10= f.text_field :message, class: 'form-control', rows: 18 -- GitLab From dc396dc4f9622e96c0a1564260e106643eb48a4a Mon Sep 17 00:00:00 2001 From: Timothy Andrew Date: Thu, 2 Jun 2016 14:25:17 +0530 Subject: [PATCH 3/6] Remove the `non-file` qualifier for root links. --- doc/markdown/wiki.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/markdown/wiki.md b/doc/markdown/wiki.md index b58107abea36..fa9b3298edb5 100644 --- a/doc/markdown/wiki.md +++ b/doc/markdown/wiki.md @@ -62,7 +62,7 @@ A link can be constructed relative to the current wiki page using `./`, `. ### Root Link -A link starting with a `/` is relative to the wiki root, for non-file links. +A link starting with a `/` is relative to the wiki root. 1. This snippet links to `/documentation` -- GitLab From 97c61900e4bd764fa772f349a2996d8d940795b1 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Tue, 2 Aug 2016 13:17:04 +0300 Subject: [PATCH 4/6] Refactor wiki Markdown documentation --- doc/markdown/wiki.md | 60 ++++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/doc/markdown/wiki.md b/doc/markdown/wiki.md index fa9b3298edb5..d9e6d071b9f5 100644 --- a/doc/markdown/wiki.md +++ b/doc/markdown/wiki.md @@ -1,76 +1,86 @@ -# Wiki-Specific Markdown +# Wiki-specific Markdown -## Table of Contents +This page has information related to wiki-specific Markdown. For more +information on GitLab's Markdown, see the [main Markdown document](./markdown.md). -* [Links to Other Wiki Pages](#links-to-other-wiki-pages) - * [Direct Page Link](#direct-page-link) - * [Direct File Link](#direct-file-link) - * [Hierarchical Link](#hierarchical-link) - * [Root Link](#root-link) +## Table of contents -## Links to Other Wiki Pages +* [Links to other wiki pages](#links-to-other-wiki-pages) + * [Direct page link](#direct-page-link) + * [Direct file link](#direct-file-link) + * [Hierarchical link](#hierarchical-link) + * [Root link](#root-link) + +## Links to other wiki pages You can link to other pages on your wiki in a few different ways. -### Direct Page Link +### Direct page link -A link which just includes the slug for a page will point to that page, _at the base level of the wiki_. +A link which just includes the slug for a page will point to that page, +_at the base level of the wiki_. -1. This snippet would link to a `documentation` page at the root of your wiki. +This snippet would link to a `documentation` page at the root of your wiki: ```markdown [Link to Documentation](documentation) ``` -### Direct File Link +### Direct file link Links with a file extension point to that file, _relative to the current page_. -1. If this snippet was placed on a page at `/documentation/related`, it would link to `/documentation/file.md`. +If this snippet was placed on a page at `/documentation/related`, +it would link to `/documentation/file.md`: - ```markdown - [Link to File](file.md) - ``` +```markdown +[Link to File](file.md) +``` -### Hierarchical Link +### Hierarchical link -A link can be constructed relative to the current wiki page using `./`, `../`, etc. +A link can be constructed relative to the current wiki page using `./`, +`../`, etc. -1. If this snippet was placed on a page at `/documentation/main`, it would link to `/documentation/related`. +- If this snippet was placed on a page at `/documentation/main`, + it would link to `/documentation/related`: ```markdown [Link to Related Page](./related) ``` -1. If this snippet was placed on a page at `/documentation/related/content`, it would link to `/documentation/main`. +- If this snippet was placed on a page at `/documentation/related/content`, + it would link to `/documentation/main`: ```markdown [Link to Related Page](../main) ``` -1. If this snippet was placed on a page at `/documentation/main`, it would link to `/documentation/related.md`. +- If this snippet was placed on a page at `/documentation/main`, + it would link to `/documentation/related.md`: ```markdown [Link to Related Page](./related.md) ``` -1. If this snippet was placed on a page at `/documentation/related/content`, it would link to `/documentation/main.md`. +- If this snippet was placed on a page at `/documentation/related/content`, + it would link to `/documentation/main.md`: ```markdown [Link to Related Page](../main.md) ``` -### Root Link +### Root link A link starting with a `/` is relative to the wiki root. -1. This snippet links to `/documentation` +- This snippet links to `/documentation`: ```markdown [Link to Related Page](/documentation) ``` -1. This snippet links to `/miscellaneous.md` +- This snippet links to `/miscellaneous.md`: ```markdown [Link to Related Page](/miscellaneous.md) -- GitLab From 4611191785f2ca0eca2ba5be3b24224879bc5c50 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Tue, 2 Aug 2016 13:34:49 +0300 Subject: [PATCH 5/6] Merge wiki-specific Markdown in main Markdown file --- doc/markdown/markdown.md | 82 ++++++++++++++++++++++++++++++++++++- doc/markdown/wiki.md | 87 ---------------------------------------- 2 files changed, 80 insertions(+), 89 deletions(-) delete mode 100644 doc/markdown/wiki.md diff --git a/doc/markdown/markdown.md b/doc/markdown/markdown.md index e4101fa53888..d7f09ec070cf 100644 --- a/doc/markdown/markdown.md +++ b/doc/markdown/markdown.md @@ -28,9 +28,12 @@ * [Line Breaks](#line-breaks) * [Tables](#tables) -**[Wiki-Specific Markdown](wiki.md)** +**[Wiki-Specific Markdown](#wiki-specific-markdown)** -* [Links](wiki.md#links-to-other-wiki-pages) +* [Wiki - Direct page link](#wiki-direct-page-link) +* [Wiki - Direct file link](#wiki-direct-file-link) +* [Wiki - Hierarchical link](#wiki-hierarchical-link) +* [Wiki - Root link](#wiki-root-link) **[References](#references)** @@ -696,6 +699,81 @@ By including colons in the header row, you can align the text within that column | Cell 1 | Cell 2 | Cell 3 | Cell 4 | Cell 5 | Cell 6 | | Cell 7 | Cell 8 | Cell 9 | Cell 10 | Cell 11 | Cell 12 | + +## Wiki-specific Markdown + +The following examples show how links inside wikis behave. + +### Wiki - Direct page link + +A link which just includes the slug for a page will point to that page, +_at the base level of the wiki_. + +This snippet would link to a `documentation` page at the root of your wiki: + +```markdown +[Link to Documentation](documentation) +``` + +### Wiki - Direct file link + +Links with a file extension point to that file, _relative to the current page_. + +If this snippet was placed on a page at `/documentation/related`, +it would link to `/documentation/file.md`: + +```markdown +[Link to File](file.md) +``` + +### Wiki - Hierarchical link + +A link can be constructed relative to the current wiki page using `./`, +`../`, etc. + +- If this snippet was placed on a page at `/documentation/main`, + it would link to `/documentation/related`: + + ```markdown + [Link to Related Page](./related) + ``` + +- If this snippet was placed on a page at `/documentation/related/content`, + it would link to `/documentation/main`: + + ```markdown + [Link to Related Page](../main) + ``` + +- If this snippet was placed on a page at `/documentation/main`, + it would link to `/documentation/related.md`: + + ```markdown + [Link to Related Page](./related.md) + ``` + +- If this snippet was placed on a page at `/documentation/related/content`, + it would link to `/documentation/main.md`: + + ```markdown + [Link to Related Page](../main.md) + ``` + +### Wiki - Root link + +A link starting with a `/` is relative to the wiki root. + +- This snippet links to `/documentation`: + + ```markdown + [Link to Related Page](/documentation) + ``` + +- This snippet links to `/miscellaneous.md`: + + ```markdown + [Link to Related Page](/miscellaneous.md) + ``` ## References - This document leveraged heavily from the [Markdown-Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet). diff --git a/doc/markdown/wiki.md b/doc/markdown/wiki.md deleted file mode 100644 index d9e6d071b9f5..000000000000 --- a/doc/markdown/wiki.md +++ /dev/null @@ -1,87 +0,0 @@ -# Wiki-specific Markdown - -This page has information related to wiki-specific Markdown. For more -information on GitLab's Markdown, see the [main Markdown document](./markdown.md). - -## Table of contents - -* [Links to other wiki pages](#links-to-other-wiki-pages) - * [Direct page link](#direct-page-link) - * [Direct file link](#direct-file-link) - * [Hierarchical link](#hierarchical-link) - * [Root link](#root-link) - -## Links to other wiki pages - -You can link to other pages on your wiki in a few different ways. - -### Direct page link - -A link which just includes the slug for a page will point to that page, -_at the base level of the wiki_. - -This snippet would link to a `documentation` page at the root of your wiki: - -```markdown -[Link to Documentation](documentation) -``` - -### Direct file link - -Links with a file extension point to that file, _relative to the current page_. - -If this snippet was placed on a page at `/documentation/related`, -it would link to `/documentation/file.md`: - -```markdown -[Link to File](file.md) -``` - -### Hierarchical link - -A link can be constructed relative to the current wiki page using `./`, -`../`, etc. - -- If this snippet was placed on a page at `/documentation/main`, - it would link to `/documentation/related`: - - ```markdown - [Link to Related Page](./related) - ``` - -- If this snippet was placed on a page at `/documentation/related/content`, - it would link to `/documentation/main`: - - ```markdown - [Link to Related Page](../main) - ``` - -- If this snippet was placed on a page at `/documentation/main`, - it would link to `/documentation/related.md`: - - ```markdown - [Link to Related Page](./related.md) - ``` - -- If this snippet was placed on a page at `/documentation/related/content`, - it would link to `/documentation/main.md`: - - ```markdown - [Link to Related Page](../main.md) - ``` - -### Root link - -A link starting with a `/` is relative to the wiki root. - -- This snippet links to `/documentation`: - - ```markdown - [Link to Related Page](/documentation) - ``` - -- This snippet links to `/miscellaneous.md`: - - ```markdown - [Link to Related Page](/miscellaneous.md) - ``` -- GitLab From fc492c890596c996ad270dcbcd5d76c2b748cbeb Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Tue, 2 Aug 2016 13:42:14 +0300 Subject: [PATCH 6/6] Change Markdown document location --- app/views/projects/wikis/_form.html.haml | 2 +- doc/README.md | 2 +- .../logo.png => user/project/img/markdown_logo.png} | Bin .../project/img/markdown_video.mp4} | Bin doc/{markdown => user/project}/markdown.md | 12 ++++++------ 5 files changed, 8 insertions(+), 8 deletions(-) rename doc/{markdown/img/logo.png => user/project/img/markdown_logo.png} (100%) rename doc/{markdown/img/video.mp4 => user/project/img/markdown_video.mp4} (100%) rename doc/{markdown => user/project}/markdown.md (99%) diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index 6360371804a1..643f7c589e65 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -24,7 +24,7 @@ = succeed '.' do More examples are in the - = link_to 'documentation', help_page_path(category: 'markdown', file: 'wiki', format: 'md') + = link_to 'documentation', help_page_path("user/project/markdown", anchor: "wiki-specific-markdown") .form-group = f.label :commit_message, class: 'control-label' diff --git a/doc/README.md b/doc/README.md index b5b377822e6e..751e685b19ba 100644 --- a/doc/README.md +++ b/doc/README.md @@ -9,7 +9,7 @@ - [GitLab Basics](gitlab-basics/README.md) Find step by step how to start working on your commandline and on GitLab. - [Importing to GitLab](workflow/importing/README.md). - [Importing and exporting projects between instances](user/project/settings/import_export.md). -- [Markdown](markdown/markdown.md) GitLab's advanced formatting system. +- [Markdown](user/project/markdown.md) GitLab's advanced formatting system. - [Migrating from SVN](workflow/importing/migrating_from_svn.md) Convert a SVN repository to Git and GitLab. - [Permissions](user/permissions.md) Learn what each role in a project (external/guest/reporter/developer/master/owner) can do. - [Profile Settings](profile/README.md) diff --git a/doc/markdown/img/logo.png b/doc/user/project/img/markdown_logo.png similarity index 100% rename from doc/markdown/img/logo.png rename to doc/user/project/img/markdown_logo.png diff --git a/doc/markdown/img/video.mp4 b/doc/user/project/img/markdown_video.mp4 similarity index 100% rename from doc/markdown/img/video.mp4 rename to doc/user/project/img/markdown_video.mp4 diff --git a/doc/markdown/markdown.md b/doc/user/project/markdown.md similarity index 99% rename from doc/markdown/markdown.md rename to doc/user/project/markdown.md index d7f09ec070cf..7fe96e67dbbf 100644 --- a/doc/markdown/markdown.md +++ b/doc/user/project/markdown.md @@ -338,11 +338,11 @@ The valid video extensions are `.mp4`, `.m4v`, `.mov`, `.webm`, and `.ogv`. Here's a sample video: - ![Sample Video](img/video.mp4) + ![Sample Video](img/markdown_video.mp4) Here's a sample video: -![Sample Video](img/video.mp4) +![Sample Video](img/markdown_video.mp4) # Standard Markdown @@ -540,24 +540,24 @@ will point the link to `wikis/style` when the link is inside of a wiki markdown Here's our logo (hover to see the title text): Inline-style: - ![alt text](img/logo.png) + ![alt text](img/markdown_logo.png) Reference-style: ![alt text1][logo] - [logo]: img/logo.png + [logo]: img/markdown_logo.png Here's our logo: Inline-style: -![alt text](img/logo.png) +![alt text](img/markdown_logo.png) Reference-style: ![alt text][logo] -[logo]: img/logo.png +[logo]: img/markdown_logo.png ## Blockquotes -- GitLab