diff options
Diffstat (limited to 'glfm_specification/input/gitlab_flavored_markdown')
4 files changed, 251 insertions, 29 deletions
diff --git a/glfm_specification/input/gitlab_flavored_markdown/glfm_canonical_examples.txt b/glfm_specification/input/gitlab_flavored_markdown/glfm_canonical_examples.txt index 332b311dff2..10a46dcca6b 100644 --- a/glfm_specification/input/gitlab_flavored_markdown/glfm_canonical_examples.txt +++ b/glfm_specification/input/gitlab_flavored_markdown/glfm_canonical_examples.txt @@ -13,7 +13,7 @@ examples may be split into multiple top-level headings in the future. See [the footnotes section of the user-facing documentation for GitLab Flavored Markdown](https://docs.gitlab.com/ee/user/markdown.html#footnotes). -```````````````````````````````` example gitlab footnote +```````````````````````````````` example gitlab footnote reference tag [^fortytwo] [^fortytwo]: footnote text @@ -55,7 +55,7 @@ The following are some basic examples; more examples may be added in the future. Incomplete task: -```````````````````````````````` example gitlab tasklist +```````````````````````````````` example gitlab - [ ] incomplete . <ul> @@ -69,7 +69,7 @@ incomplete Completed task: -```````````````````````````````` example gitlab tasklist +```````````````````````````````` example gitlab - [x] completed . <ul> @@ -83,7 +83,7 @@ completed Inapplicable task: -```````````````````````````````` example gitlab tasklist +```````````````````````````````` example gitlab - [~] inapplicable . <ul> @@ -100,7 +100,7 @@ inapplicable Inapplicable task in a "loose" list. Note that the `<del>` tag is not applied to the loose text; it has strikethrough applied with CSS. -```````````````````````````````` example gitlab tasklist +```````````````````````````````` example gitlab - [~] inapplicable text in loose list @@ -131,7 +131,7 @@ This data can be used by static site generators like Jekyll, Hugo, and many othe YAML front matter: -```````````````````````````````` example gitlab frontmatter +```````````````````````````````` example gitlab --- title: YAML front matter --- @@ -145,7 +145,7 @@ title: YAML front matter TOML front matter: -```````````````````````````````` example gitlab frontmatter +```````````````````````````````` example gitlab +++ title: TOML front matter +++ @@ -159,7 +159,7 @@ title: TOML front matter JSON front matter: -```````````````````````````````` example gitlab frontmatter +```````````````````````````````` example gitlab ;;; { "title": "JSON front matter" @@ -177,7 +177,7 @@ JSON front matter: Front matter blocks should be inserted at the top of the document: -```````````````````````````````` example gitlab frontmatter +```````````````````````````````` example gitlab text --- @@ -191,7 +191,7 @@ title: YAML front matter Front matter block delimiters shouldn’t be preceded by space characters: -```````````````````````````````` example gitlab frontmatter +```````````````````````````````` example gitlab --- title: YAML front matter --- @@ -199,3 +199,191 @@ title: YAML front matter <hr> <h2>title: YAML front matter</h2> ```````````````````````````````` + +## Audio + +See +[audio](https://docs.gitlab.com/ee/user/markdown.html#audio) in the GitLab Flavored Markdown documentation. + +GLFM renders image elements as an audio player as long as the resource’s file extension is +one of the following supported audio extensions `.mp3`, `.oga`, `.ogg`, `.spx`, and `.wav`. +Audio ignore the alternative text part of an image declaration. + +```````````````````````````````` example gitlab +![audio](audio.oga "audio title") +. +<p><audio src="audio.oga" title="audio title"></audio></p> +```````````````````````````````` + +Reference definitions work audio as well: + +```````````````````````````````` example gitlab +[audio]: audio.oga "audio title" + +![audio][audio] +. +<p><audio src="audio.oga" title="audio title"></audio></p> +```````````````````````````````` + +## Video + +See +[videos](https://docs.gitlab.com/ee/user/markdown.html#videos) in the GitLab Flavored Markdown documentation. + +GLFM renders image elements as a video player as long as the resource’s file extension is +one of the following supported video extensions `.mp4`, `.m4v`, `.mov`, `.webm`, and `.ogv`. +Videos ignore the alternative text part of an image declaration. + + +```````````````````````````````` example gitlab +![video](video.m4v "video title") +. +<p><video src="video.m4v" title="video title"></video></p> +```````````````````````````````` + +Reference definitions work video as well: + +```````````````````````````````` example gitlab +[video]: video.mov "video title" + +![video][video] +. +<p><video src="video.mov" title="video title"></video></p> +```````````````````````````````` + +## Table of contents + +See +[table of contents](https://docs.gitlab.com/ee/user/markdown.html#table-of-contents) +in the GitLab Flavored Markdown documentation. + +A table of contents is an unordered list that links to subheadings in the document. +Add either the `[[_TOC_]]` or `[TOC]` tag on its own line. + +```````````````````````````````` example gitlab +[TOC] + +# Heading 1 + +## Heading 2 +. +<nav> + <ul> + <li><a href="#heading-1">Heading 1</a></li> + <ul> + <li><a href="#heading-2">Heading 2</a></li> + </ul> + </ul> +</nav> +<h1>Heading 1</h1> +<h2>Heading 2</h2> +```````````````````````````````` + +```````````````````````````````` example gitlab +[[_TOC_]] + +# Heading 1 + +## Heading 2 +. +<nav> + <ul> + <li><a href="#heading-1">Heading 1</a></li> + <ul> + <li><a href="#heading-2">Heading 2</a></li> + </ul> + </ul> +</nav> +<h1>Heading 1</h1> +<h2>Heading 2</h2> +```````````````````````````````` + +A table of contents is a block element. It should preceded and followed by a blank +line. + +```````````````````````````````` example gitlab +[[_TOC_]] +text + +text +[TOC] +. +<p>[[<em>TOC</em>]]text</p> +<p>text[TOC]</p> +```````````````````````````````` + +A table of contents can be indented with up to three spaces. + +```````````````````````````````` example gitlab + [[_TOC_]] + +# Heading 1 +. +<nav> + <ul> + <li><a href="#heading-1">Heading 1</a></li> + </ul> +</nav> +<h1>Heading 1</h1> +```````````````````````````````` + +# Examples Using Internal Extensions + +## Markdown Preview API Request Overrides + +This section contains examples of all controllers which use `PreviewMarkdown` module +and use different `markdown_context_params`. They exercise the various `preview_markdown` +endpoints via `glfm_example_metadata.yml`. + + +`preview_markdown` exercising `groups` API endpoint and `UploadLinkFilter`: + +```````````````````````````````` example gitlab +[groups-test-file](/uploads/groups-test-file) +. +<p><a href="groups-test-file">groups-test-file</a></p> +```````````````````````````````` + +`preview_markdown` exercising `projects` API endpoint and `RepositoryLinkFilter`: + +```````````````````````````````` example gitlab +[projects-test-file](projects-test-file) +. +<p><a href="projects-test-file">projects-test-file</a></p> +```````````````````````````````` + +`preview_markdown` exercising `projects` API endpoint and `SnippetReferenceFilter`: + +```````````````````````````````` example gitlab +This project snippet ID reference IS filtered: $88888 +. +<p>This project snippet ID reference IS filtered: $88888</p> +```````````````````````````````` + +`preview_markdown` exercising personal (non-project) `snippets` API endpoint. This is +only used by the comment field on personal snippets. It has no unique custom markdown +extension behavior, and specifically does not render snippet references via +`SnippetReferenceFilter`, even if the ID is valid. + +```````````````````````````````` example gitlab +This personal snippet ID reference is not filtered: $99999 +. +<p>This personal snippet ID reference is not filtered: $99999</p> +```````````````````````````````` + +`preview_markdown` exercising project `wikis` API endpoint and `WikiLinkFilter`: + +```````````````````````````````` example gitlab +[project-wikis-test-file](project-wikis-test-file) +. +<p><a href="project-wikis-test-file">project-wikis-test-file</a></p> +```````````````````````````````` + +`preview_markdown` exercising group `wikis` API endpoint and `WikiLinkFilter`. This example +also requires an EE license enabling the `group_wikis` feature: + +```````````````````````````````` example gitlab +[group-wikis-test-file](group-wikis-test-file) +. +<p><a href="group-wikis-test-file">group-wikis-test-file</a></p> +```````````````````````````````` diff --git a/glfm_specification/input/gitlab_flavored_markdown/glfm_example_metadata.yml b/glfm_specification/input/gitlab_flavored_markdown/glfm_example_metadata.yml new file mode 100644 index 00000000000..3c043f5fba1 --- /dev/null +++ b/glfm_specification/input/gitlab_flavored_markdown/glfm_example_metadata.yml @@ -0,0 +1,14 @@ +--- +08_01_00__examples_using_internal_extensions__markdown_preview_api_request_overrides__001: + api_request_override_path: /groups/glfm_group/preview_markdown +08_01_00__examples_using_internal_extensions__markdown_preview_api_request_overrides__002: + api_request_override_path: /glfm_group/glfm_project/preview_markdown +08_01_00__examples_using_internal_extensions__markdown_preview_api_request_overrides__003: + api_request_override_path: /glfm_group/glfm_project/preview_markdown +08_01_00__examples_using_internal_extensions__markdown_preview_api_request_overrides__004: + api_request_override_path: /-/snippets/preview_markdown +08_01_00__examples_using_internal_extensions__markdown_preview_api_request_overrides__005: + api_request_override_path: /glfm_group/glfm_project/-/wikis/new_page/preview_markdown +08_01_00__examples_using_internal_extensions__markdown_preview_api_request_overrides__006: + ee: true + api_request_override_path: /groups/glfm_group/-/wikis/new_page/preview_markdown diff --git a/glfm_specification/input/gitlab_flavored_markdown/glfm_example_normalizations.yml b/glfm_specification/input/gitlab_flavored_markdown/glfm_example_normalizations.yml index 15df659f0f4..d576a8ddb51 100644 --- a/glfm_specification/input/gitlab_flavored_markdown/glfm_example_normalizations.yml +++ b/glfm_specification/input/gitlab_flavored_markdown/glfm_example_normalizations.yml @@ -9,19 +9,3 @@ 00_uri: &00_uri - regex: '(href|data-src)(=")(.*?)(test-file\.(png|zip)")' replacement: '\1\2URI_PREFIX\4' -07_01__gitlab_specific_markdown__footnotes__001: - html: - static: - shared: - 07_01_href: &07_01_href - - regex: '(href)(=")(.+?)(")' - replacement: '\1\2REF\4' - 07_01_id: &07_01_id - - regex: '(id)(=")(.+?)(")' - replacement: '\1\2ID\4' - canonical: - 07_01_href: *07_01_href - 07_01_id: *07_01_id - snapshot: - 07_01_href: *07_01_href - 07_01_id: *07_01_id diff --git a/glfm_specification/input/gitlab_flavored_markdown/glfm_example_status.yml b/glfm_specification/input/gitlab_flavored_markdown/glfm_example_status.yml index 3881819e38a..a74c3492324 100644 --- a/glfm_specification/input/gitlab_flavored_markdown/glfm_example_status.yml +++ b/glfm_specification/input/gitlab_flavored_markdown/glfm_example_status.yml @@ -1,5 +1,5 @@ --- -02_01__preliminaries__tabs__001: +02_01_00__preliminaries__tabs__001: # NOTE: False values are optional, they are only included here for reference. See # https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#glfm_example_statusyml # for more details. @@ -12,15 +12,51 @@ skip_running_snapshot_static_html_tests: false # NOT YET SUPPORTED skip_running_snapshot_wysiwyg_html_tests: false skip_running_snapshot_prosemirror_json_tests: false -07_02__gitlab_specific_markdown__task_list_items__003: +07_02_00__gitlab_specific_markdown__task_list_items__003: skip_update_example_snapshot_html_wysiwyg: Inapplicable task list items not yet implemented for WYSYWIG skip_update_example_snapshot_prosemirror_json: Inapplicable task list items not yet implemented for WYSYWIG skip_running_conformance_wysiwyg_tests: Inapplicable task list items not yet implemented for WYSYWIG skip_running_snapshot_wysiwyg_html_tests: Inapplicable task list items not yet implemented for WYSYWIG skip_running_snapshot_prosemirror_json_tests: Inapplicable task list items not yet implemented for WYSYWIG -07_02__gitlab_specific_markdown__task_list_items__004: +07_02_00__gitlab_specific_markdown__task_list_items__004: skip_update_example_snapshot_html_wysiwyg: Inapplicable task list items not yet implemented for WYSYWIG skip_update_example_snapshot_prosemirror_json: Inapplicable task list items not yet implemented for WYSYWIG skip_running_conformance_wysiwyg_tests: Inapplicable task list items not yet implemented for WYSYWIG skip_running_snapshot_wysiwyg_html_tests: Inapplicable task list items not yet implemented for WYSYWIG skip_running_snapshot_prosemirror_json_tests: Inapplicable task list items not yet implemented for WYSYWIG +08_01_00__examples_using_internal_extensions__markdown_preview_api_request_overrides__001: + skip_update_example_snapshot_html_wysiwyg: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_update_example_snapshot_prosemirror_json: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_conformance_wysiwyg_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_snapshot_wysiwyg_html_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_snapshot_prosemirror_json_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 +08_01_00__examples_using_internal_extensions__markdown_preview_api_request_overrides__002: + skip_update_example_snapshot_html_wysiwyg: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_update_example_snapshot_prosemirror_json: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_conformance_wysiwyg_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_snapshot_wysiwyg_html_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_snapshot_prosemirror_json_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 +08_01_00__examples_using_internal_extensions__markdown_preview_api_request_overrides__003: + skip_update_example_snapshot_html_wysiwyg: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_update_example_snapshot_prosemirror_json: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_conformance_wysiwyg_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_snapshot_wysiwyg_html_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_snapshot_prosemirror_json_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 +08_01_00__examples_using_internal_extensions__markdown_preview_api_request_overrides__004: + skip_update_example_snapshot_html_wysiwyg: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_update_example_snapshot_prosemirror_json: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_conformance_wysiwyg_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_snapshot_wysiwyg_html_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_snapshot_prosemirror_json_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 +08_01_00__examples_using_internal_extensions__markdown_preview_api_request_overrides__005: + skip_update_example_snapshot_html_wysiwyg: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_update_example_snapshot_prosemirror_json: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_conformance_wysiwyg_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_snapshot_wysiwyg_html_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_snapshot_prosemirror_json_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 +08_01_00__examples_using_internal_extensions__markdown_preview_api_request_overrides__006: + skip_update_example_snapshot_html_wysiwyg: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_update_example_snapshot_prosemirror_json: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_conformance_wysiwyg_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_snapshot_wysiwyg_html_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 + skip_running_snapshot_prosemirror_json_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 |