Skip to content

Commit 53a6365

Browse files
authored
Merge pull request #423 from commonmark/alerts-followup
Alerts extension followups
2 parents 471e639 + 6621065 commit 53a6365

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,19 @@ Enables tables using pipes as in [GitHub Flavored Markdown][gfm-tables].
333333

334334
Use class `TablesExtension` in artifact `commonmark-ext-gfm-tables`.
335335

336+
### Alerts
337+
338+
Adds support for GitHub-style alerts (also known as callouts or admonitions) as described [here](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts), e.g.:
339+
340+
```
341+
> [!NOTE]
342+
> The text of the note.
343+
```
344+
345+
As types you can use NOTE, TIP, IMPORTANT, WARNING, CAUTION; or configure the extension to add additional ones.
346+
347+
Use class `AlertsExtension` in artifact `commonmark-ext-gfm-alerts`.
348+
336349
### Footnotes
337350

338351
Enables footnotes like in [GitHub](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#footnotes)

commonmark-integration-test/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
<groupId>org.commonmark</groupId>
2929
<artifactId>commonmark-ext-ins</artifactId>
3030
</dependency>
31+
<dependency>
32+
<groupId>org.commonmark</groupId>
33+
<artifactId>commonmark-ext-gfm-alerts</artifactId>
34+
</dependency>
3135
<dependency>
3236
<groupId>org.commonmark</groupId>
3337
<artifactId>commonmark-ext-gfm-strikethrough</artifactId>

commonmark-integration-test/src/test/java/org/commonmark/integration/Extensions.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.commonmark.ext.autolink.AutolinkExtension;
55
import org.commonmark.ext.footnotes.FootnotesExtension;
66
import org.commonmark.ext.front.matter.YamlFrontMatterExtension;
7+
import org.commonmark.ext.gfm.alerts.AlertsExtension;
78
import org.commonmark.ext.gfm.strikethrough.StrikethroughExtension;
89
import org.commonmark.ext.gfm.tables.TablesExtension;
910
import org.commonmark.ext.image.attributes.ImageAttributesExtension;
@@ -19,6 +20,7 @@ public class Extensions {
1920
FootnotesExtension.create(),
2021
ImageAttributesExtension.create(),
2122
InsExtension.create(),
23+
AlertsExtension.create(),
2224
StrikethroughExtension.create(),
2325
TablesExtension.create(),
2426
TaskListItemsExtension.create(),

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@
155155
<artifactId>commonmark-ext-ins</artifactId>
156156
<version>0.27.2-SNAPSHOT</version>
157157
</dependency>
158+
<dependency>
159+
<groupId>org.commonmark</groupId>
160+
<artifactId>commonmark-ext-gfm-alerts</artifactId>
161+
<version>0.27.2-SNAPSHOT</version>
162+
</dependency>
158163
<dependency>
159164
<groupId>org.commonmark</groupId>
160165
<artifactId>commonmark-ext-gfm-strikethrough</artifactId>

0 commit comments

Comments
 (0)