From cd9b9c98622eb9ddb8a283de0ee1eacf64036acb Mon Sep 17 00:00:00 2001 From: geoffreymcgill Date: Wed, 21 Apr 2021 20:03:46 -0600 Subject: [PATCH 1/2] Initial setup and configure of Retype --- .github/workflows/ci.yml | 7 +++++-- .github/workflows/retype.yml | 25 ++++++++++++++++++++++ .gitignore | 3 +++ api/index.yml | 2 ++ changelog.md | 15 ++++++++------ img/markdig-logo-dark.svg | 6 ++++++ img/markdig-logo.svg | 6 ++++++ readme.md | 28 ++++++++++++++++--------- retype.json | 40 ++++++++++++++++++++++++++++++++++++ 9 files changed, 114 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/retype.yml create mode 100644 api/index.yml create mode 100644 img/markdig-logo-dark.svg create mode 100644 img/markdig-logo.svg create mode 100644 retype.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc16c175b..addc80d5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,11 @@ on: paths-ignore: - 'doc/**' - 'img/**' + - 'api/**' - 'changelog.md' - 'readme.md' + - 'retype.json' + - '.github/workflows/retype.yml' pull_request: jobs: @@ -27,7 +30,7 @@ jobs: - name: Build (Release) run: dotnet build src -c Release - + - name: SpecFileGen run: dotnet src/SpecFileGen/bin/Release/net5.0/SpecFileGen.dll @@ -55,7 +58,7 @@ jobs: - name: Publish if: github.event_name == 'push' - run: | + run: | if ( "${{github.ref}}" -match "^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$" ) { dotnet nuget push src\${{env.PROJECT_NAME}}\bin\Release\*.nupkg -s nuget.org -k ${{secrets.NUGET_TOKEN}} dotnet nuget push src\${{env.PROJECT_NAME}}.Signed\bin\Release\*.nupkg -s nuget.org -k ${{secrets.NUGET_TOKEN}} diff --git a/.github/workflows/retype.yml b/.github/workflows/retype.yml new file mode 100644 index 000000000..c394c0062 --- /dev/null +++ b/.github/workflows/retype.yml @@ -0,0 +1,25 @@ +name: Retype publish to GitHub Pages +on: + workflow_dispatch: + push: + branches: + - master + +jobs: + publish: + name: Publish to retype branch + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.x + + - uses: retypeapp/action-build@v1 + + - uses: retypeapp/action-github@v1 + with: + update-branch: true \ No newline at end of file diff --git a/.gitignore b/.gitignore index ff554453f..3252463de 100644 --- a/.gitignore +++ b/.gitignore @@ -239,3 +239,6 @@ _Pvt_Extensions **/.idea/**/*.iml **/.idea/**/contentModel.xml **/.idea/**/modules.xml + +# Custom +.retype/ diff --git a/api/index.yml b/api/index.yml new file mode 100644 index 000000000..63557e64b --- /dev/null +++ b/api/index.yml @@ -0,0 +1,2 @@ +icon: gear +label: API Reference \ No newline at end of file diff --git a/changelog.md b/changelog.md index 4d9e5ac24..bee7e884a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +--- +icon: checklist +--- # Changelog ## 0.24.0 (20 Mar 2021) @@ -36,11 +39,11 @@ ## 0.20.0 (18 Apr 2020) - Markdig is now compatible only with `NETStandard 2.0`, `NETStandard 2.1`, `NETCoreApp 2.1` and `NETCoreApp 3.1`. -- Many performance improvements from [PR #416](https://github.com/lunet-io/markdig/pull/416) +- Many performance improvements from [PR #416](https://github.com/lunet-io/markdig/pull/416) [PR #417](https://github.com/lunet-io/markdig/pull/417) -[PR #418](https://github.com/lunet-io/markdig/pull/418) -[PR #421](https://github.com/lunet-io/markdig/pull/421) -[PR #422](https://github.com/lunet-io/markdig/pull/422) +[PR #418](https://github.com/lunet-io/markdig/pull/418) +[PR #421](https://github.com/lunet-io/markdig/pull/421) +[PR #422](https://github.com/lunet-io/markdig/pull/422) [PR #410](https://github.com/lunet-io/markdig/pull/410) ## 0.18.3 (8 Mar 2020) @@ -150,10 +153,10 @@ - Make EmojiExtension.EnableSmiley public ## 0.14.2 - Fix issue with emphasis preceded/followed by an HTML entity (#157) -- Add support for link reference definitions for Normalize renderer (#155) +- Add support for link reference definitions for Normalize renderer (#155) - Add option to disable smiley parsing in EmojiAndSmiley extension ## 0.14.1 -- Fix crash in Markdown.Normalize to handle HtmlBlock correctly +- Fix crash in Markdown.Normalize to handle HtmlBlock correctly - Add better handling of bullet character for lists in Markdown.Normalize ## 0.14.0 - Add Markdown.ToPlainText, Add option HtmlRenderer.EnableHtmlForBlock. diff --git a/img/markdig-logo-dark.svg b/img/markdig-logo-dark.svg new file mode 100644 index 000000000..36cd088a5 --- /dev/null +++ b/img/markdig-logo-dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/img/markdig-logo.svg b/img/markdig-logo.svg new file mode 100644 index 000000000..e824e0c17 --- /dev/null +++ b/img/markdig-logo.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/readme.md b/readme.md index 42a5b577d..31b91d4da 100644 --- a/readme.md +++ b/readme.md @@ -1,10 +1,18 @@ -# Markdig [![Build Status](https://github.com/lunet-io/markdig/workflows/ci/badge.svg?branch=master)](https://github.com/lunet-io/markdig/actions) [![Coverage Status](https://coveralls.io/repos/github/xoofx/markdig/badge.svg?branch=master)](https://coveralls.io/github/xoofx/markdig?branch=master) [![NuGet](https://img.shields.io/nuget/v/Markdig.svg)](https://www.nuget.org/packages/Markdig/) [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FRGHXBTP442JL) +--- +label: Welcome +icon: home +--- +# Welcome to Markdig - +[![Build Status](https://github.com/lunet-io/markdig/workflows/ci/badge.svg?branch=master)](https://github.com/lunet-io/markdig/actions) [![Coverage Status](https://coveralls.io/repos/github/lunet-io/markdig/badge.svg?branch=master)](https://coveralls.io/github/lunet-io/markdig?branch=master) [![NuGet](https://img.shields.io/nuget/v/Markdig.svg)](https://www.nuget.org/packages/Markdig/) [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FRGHXBTP442JL) + +![](img/markdig128.png)- Markdig is a fast, powerful, [CommonMark](http://commonmark.org/) compliant, extensible Markdown processor for .NET. -> NOTE: The repository is under construction. There will be a dedicated website and proper documentation at some point! +!!! +The repository is under construction. There will be a dedicated website and proper documentation at some point! +!!! You can **try Markdig online** and compare it to other implementations on [babelmark3](https://babelmark.github.io/?text=Hello+**Markdig**!) @@ -16,18 +24,18 @@ You can **try Markdig online** and compare it to other implementations on [babel - Converter to **HTML** - Passing more than **600+ tests** from the latest [CommonMark specs (0.29)](http://spec.commonmark.org/) - Includes all the core elements of CommonMark: - - including **GFM fenced code blocks**. + - including **GFM fenced code blocks**. - **Extensible** architecture - - Even the core Markdown/CommonMark parsing is pluggable, so it allows to disable builtin Markdown/Commonmark parsing (e.g [Disable HTML parsing](https://github.com/lunet-io/markdig/blob/7964bd0160d4c18e4155127a4c863d61ebd8944a/src/Markdig/MarkdownExtensions.cs#L306)) or change behaviour (e.g change matching `#` of a headers with `@`) + - Even the core Markdown/CommonMark parsing is pluggable, so it allows to disable builtin Markdown/Commonmark parsing (e.g [Disable HTML parsing](https://github.com/lunet-io/markdig/blob/7964bd0160d4c18e4155127a4c863d61ebd8944a/src/Markdig/MarkdownExtensions.cs#L306)) or change behaviour (e.g change matching `#` of a headers with `@`) - [**Roundtrip support**](./src/Markdig/Roundtrip.md): Parses trivia (whitespace, newlines and other characters) to support lossless parse ⭢ render roundtrip. This enables changing markdown documents without introducing undesired trivia changes. - Built-in with **20+ extensions**, including: - 2 kind of tables: - [**Pipe tables**](src/Markdig.Tests/Specs/PipeTableSpecs.md) (inspired from GitHub tables and [PanDoc - Pipe Tables](http://pandoc.org/README.html#extension-pipe_tables)) - - [**Grid tables**](src/Markdig.Tests/Specs/GridTableSpecs.md) (inspired from [Pandoc - Grid Tables](http://pandoc.org/README.html#extension-grid_tables)) - - [**Extra emphasis**](src/Markdig.Tests/Specs/EmphasisExtraSpecs.md) (inspired from [Pandoc - Emphasis](http://pandoc.org/README.html#strikeout) and [Markdown-it](https://markdown-it.github.io/)) + - [**Grid tables**](src/Markdig.Tests/Specs/GridTableSpecs.md) (inspired from [Pandoc - Grid Tables](http://pandoc.org/README.html#extension-grid_tables)) + - [**Extra emphasis**](src/Markdig.Tests/Specs/EmphasisExtraSpecs.md) (inspired from [Pandoc - Emphasis](http://pandoc.org/README.html#strikeout) and [Markdown-it](https://markdown-it.github.io/)) - strike through `~~`, - Subscript `~` - - Superscript `^` + - Superscript `^` - Inserted `++` - Marked `==` - [**Special attributes**](src/Markdig.Tests/Specs/GenericAttributesSpecs.md) or attached HTML attributes (inspired from [PHP Markdown Extra - Special Attributes](https://michelf.ca/projects/php-markdown/extra/#spe-attr)) @@ -54,7 +62,7 @@ You can **try Markdig online** and compare it to other implementations on [babel - Starting with Markdig version `0.20.0+`, Markdig is compatible only with `NETStandard 2.0`, `NETStandard 2.1`, `NETCoreApp 2.1` and `NETCoreApp 3.1`. If you are looking for support for an old .NET Framework 3.5 or 4.0, you can download Markdig `0.18.3`. - + ### Third Party Extensions - [**WPF/XAML Markdown Renderer**: `markdig.wpf`](https://github.com/Kryptos-FR/markdig.wpf) @@ -135,7 +143,7 @@ This is an early preview of the benchmarking against various implementations: ### Analysis of the results: - Markdig is roughly **x100 times faster than MarkdownSharp**, **30x times faster than docfx** -- **Among the best in CPU**, Extremely competitive and often faster than other implementations (not feature wise equivalent) +- **Among the best in CPU**, Extremely competitive and often faster than other implementations (not feature wise equivalent) - **15% to 30% less allocations** and GC pressure Because Marked.NET, MarkdownSharp and DocAsCode.MarkdownLite are way too slow, they are not included in the following charts: diff --git a/retype.json b/retype.json new file mode 100644 index 000000000..75a52efd7 --- /dev/null +++ b/retype.json @@ -0,0 +1,40 @@ +{ + "input": ".", + "output": ".retype", + "base": "markdig", + "branding": + { + "label": "Docs", + "logo": "img/markdig-logo.svg", + "logoDark": "img/markdig-logo-dark.svg" + }, + "meta": { + "title": " | Markdig - A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET" + }, + "links": [ + { + "text": "GitHub", + "link": "https://github.com/xoofx/markdig", + "icon": "git-pull-request" + }, + { + "text": "Try online", + "link": "https://dotnetfiddle.net/GoZXyI", + "icon": "code-square" + } + ], + "edit": { + "repo": "https://github.com/xoofx/markdig", + "branch": "master" + }, + "exclude": [ + "src" + ], + "code": [{ + "input": "src/Markdig" + }], + "footer": + { + "copyright": "© Copyright {{ year }}. All rights reserved." + } +} \ No newline at end of file From c663ae932258dbb531162f4d3113e51406dcd0da Mon Sep 17 00:00:00 2001 From: geoffreymcgill Date: Thu, 22 Apr 2021 09:58:12 -0600 Subject: [PATCH 2/2] Configure /src folder generation of .md docs --- retype.json | 4 +++- src/index.yml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 src/index.yml diff --git a/retype.json b/retype.json index 75a52efd7..2fe21aa27 100644 --- a/retype.json +++ b/retype.json @@ -28,7 +28,9 @@ "branch": "master" }, "exclude": [ - "src" + "src/Markdig.Benchmarks", + "src/Markdig.Tests/ArgumentOutOfRangeException.md", + "src/Markdig.Tests/hang.md" ], "code": [{ "input": "src/Markdig" diff --git a/src/index.yml b/src/index.yml new file mode 100644 index 000000000..7a31029d9 --- /dev/null +++ b/src/index.yml @@ -0,0 +1,2 @@ +label: Specs +icon: clippy \ No newline at end of file