Skip to content
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

feat: allow custom alert types #8735

Merged
merged 6 commits into from
May 5, 2023
Merged

feat: allow custom alert types #8735

merged 6 commits into from
May 5, 2023

Conversation

yufeih
Copy link
Contributor

@yufeih yufeih commented May 5, 2023

Allow custom alerts with the build.markdownEngineProperties.alerts property in docfx.json. The key specifies the markdown keyword without the surrounding [!, ] symbols. The value is the CSS class names.

Alert titles are by default the alert keyword in upper case and can be overridden in token.json for localization and other purposes.

We choose this approach over the >[!TIP](a title) syntax because:

  • DRY: it avoids the repetition of titles in markdown
  • Opens room for adding new alert types
  • It is easier to localize titles

fixes #7939
fixes #8391
fixes #6268

@yufeih yufeih added the new-feature Makes the pull request to appear in "New Features" section of the next release note label May 5, 2023
@yufeih yufeih closed this May 5, 2023
@yufeih yufeih reopened this May 5, 2023
@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Patch coverage: 90.00% and project coverage change: +0.05 🎉

Comparison is base (2fe10f3) 76.91% compared to head (85ce2a2) 76.96%.

❗ Current head 85ce2a2 differs from pull request most recent head a202fe0. Consider uploading reports for the commit a202fe0 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8735      +/-   ##
==========================================
+ Coverage   76.91%   76.96%   +0.05%     
==========================================
  Files         606      606              
  Lines       25065    25062       -3     
==========================================
+ Hits        19278    19290      +12     
+ Misses       5787     5772      -15     
Impacted Files Coverage Δ
...ft.DocAsCode.App/Helpers/DocumentBuilderWrapper.cs 71.83% <0.00%> (ø)
...ft.DocAsCode.MarkdigEngine.Extensions/Constants.cs 100.00% <ø> (ø)
src/docfx/Models/BuildCommand.cs 45.45% <0.00%> (+7.71%) ⬆️
....DocAsCode.MarkdigEngine/MarkdigMarkdownService.cs 87.36% <75.00%> (-0.52%) ⬇️
...ions/QuoteSectionNote/QuoteSectionNoteExtension.cs 81.81% <81.25%> (ø)
...ine/ResourceFileReaders/CompositeResourceReader.cs 88.88% <90.90%> (-6.95%) ⬇️
.../Microsoft.DocAsCode.App/Config/BuildJsonConfig.cs 86.11% <100.00%> (ø)
...oft.DocAsCode.Build.Engine/DocumentBuildContext.cs 66.66% <100.00%> (+0.54%) ⬆️
....DocAsCode.Build.Engine/DocumentBuildParameters.cs 100.00% <100.00%> (ø)
...Build.Engine/TemplateProcessors/TemplateManager.cs 88.63% <100.00%> (-0.26%) ⬇️
... and 5 more

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link

@KalleOlaviNiemitalo KalleOlaviNiemitalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of token.json in templates doesn't seem to be documented.

docs/docs/markdown.md Show resolved Hide resolved
@yufeih yufeih closed this May 5, 2023
@yufeih yufeih reopened this May 5, 2023
@yufeih yufeih merged commit fcf3d67 into main May 5, 2023
@yufeih yufeih deleted the note branch May 5, 2023 14:16
p-kostov pushed a commit to ErpNetDocs/docfx that referenced this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature Makes the pull request to appear in "New Features" section of the next release note
Projects
None yet
2 participants