-
Notifications
You must be signed in to change notification settings - Fork 32
Refactor Markdown directives for updated syntax compatibility #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4331872
Refactor Markdown directives for updated syntax compatibility
Mpdreamz fbbbf0c
Update navigation title in Markdown extensions doc
Mpdreamz bf4233c
Fix syntax for directive test in AdmonitionTests.
Mpdreamz ed3988a
Update tests/Elastic.Markdown.Tests/Directives/AdmonitionUnsupportedT…
Mpdreamz 1b61f91
Merge branch 'main' into fix/directive-syntax
Mpdreamz 994e399
Refactor directive block parsing for efficiency.
Mpdreamz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| This is a snippet included on "{{page_title}}". | ||
|
|
||
| ```{tip} | ||
| :::{tip} | ||
| This is a snippet | ||
| ``` | ||
| ::: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| --- | ||
| title: Markdown Syntax Extensions | ||
| title_navigation: Markdown Syntax | ||
| --- | ||
|
|
||
| ## Syntax | ||
|
|
||
| The new documentation fully supports [CommonMark](https://commonmark.org/) Markdown syntax. | ||
|
|
||
| On top of this widely accepted feature set we have various extensions points. | ||
|
|
||
| ## Directives | ||
|
|
||
| Directives are our main extension point over markdown and follows the following syntax | ||
|
|
||
|
|
||
| ```markdown | ||
| :::{EXTENSION} ARGUMENTS | ||
| :OPTION: VALUE | ||
|
|
||
| Nested content that will be parsed as markdown | ||
| ::: | ||
| ``` | ||
|
|
||
| - `EXTENSION` is the name of the directive e.g [`note`](admonitions.md#note) | ||
| - `ARGUMENT` some directives take a main argumnt e.g [`:::{include} _snippets/include.md`](file_inclusion.md) | ||
| - `OPTION` and `VALUE` can be used to further customize a given directive. | ||
|
|
||
| The usage of `:::` allows the nested markdown to be syntax highlighted properly by editors and web viewers. | ||
|
|
||
| Our (directives) are always wrapped in brackets `{ }`. | ||
|
|
||
| ### Nesting Directives | ||
|
|
||
| You can increase the leading semicolons to include nested directives. Here the `{note}` wraps a `{hint}`. | ||
|
|
||
| ```markdown | ||
| ::::{note} My note | ||
| :::{hint} My hint | ||
| Content displayed in the hint admonition | ||
| ::: | ||
| Content displayed in the note admonition | ||
| :::: | ||
| ``` | ||
|
|
||
| ## Literal directives | ||
|
|
||
| For best editor compatability it is recommended to use triple backticks for content that needs to be displayed literally | ||
|
|
||
| ````markdown | ||
| ```js | ||
| const x = 1; | ||
| ``` | ||
| ```` | ||
|
|
||
| Many markdown editors support syntax highlighting for embedded code blocks. | ||
|
|
||
| ## Github Flavored Markdown | ||
|
|
||
| We support some of GitHub flavor markdown extensions these are highlighted in green here: https://github.github.com/gfm/ | ||
|
|
||
| Supported: | ||
|
|
||
| * GFM Tables [](tables.md#github-flavored-markdown-gfm-table) | ||
| * Strikethrough ~~as seen here~~ | ||
|
|
||
| Not supported: | ||
|
|
||
| * Task lists | ||
| * Auto links (http://www.elastic.co) | ||
| * Using a subset of html | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,6 @@ | |
| title: Sidebars | ||
| --- | ||
|
|
||
| ```{warning} | ||
| :::{warning} | ||
| This feature is not currently supported in Elastic Docs V3. | ||
| ``` | ||
| ::: | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.