Skip to content

Commit e2cea5b

Browse files
authored
docs(markdown-format): create adr for markdown format (#3055)
create an adr discussing how/why the team shall adopt CommonMark as the standard for the docs-readme output target
1 parent 9fc7657 commit e2cea5b

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# 12. Output Markdown Format
2+
3+
Date: 2021.09.09
4+
5+
## Status
6+
7+
proposed
8+
9+
## Context
10+
11+
Stencil has an output target that is capable of generating markdown documentation for the components that it compiles.
12+
Markdown does not have a unifying standard, which has led to multiple different implementations of how the markup is
13+
parsed. This has resulted in various markdown renderers whose implementations yield different renderings. Depending on
14+
where an individual views a markdown file, the results may look incorrect.
15+
16+
There was a [recent pull request](https://github.com/ionic-team/stencil/pull/3042/) that the team ultimately decided to
17+
close for not following CommonMark, which is the proposed/intended solution. Stencil should formally decide on a
18+
proposed standard and use that for guidance as to how markdown should be formatted.
19+
20+
## Options
21+
22+
1. [Describe the many options, their pros/cons, side effects, and any perspective a given team member has]
23+
2. Adopt [CommonMark](https://commonmark.org/)
24+
1. Pros:
25+
1. It has industry support from the likes of GitHub, GitLab, Qt, and more
26+
2. It seems to be the leading effort to create an unambiguous specification for Markdown
27+
3. Using a well adopted standard may lead to less chance of Markdown renderings not working as intended
28+
2. Cons
29+
1. Not everyone may be familiar with CommonMark, leading to confusion when reviewing pull requests
30+
2. CommonMark has yet to produce a v1.0 specification
31+
3. CommonMark does not define a syntax for tables, requiring they be written as
32+
[HTML](https://spec.commonmark.org/0.30/#html-blocks)
33+
3. Adopt [GitHub Flavored Markdown (GFM)](https://github.github.com/gfm/)
34+
1. Pros:
35+
1. Individuals may be more familiar with GFM, given the popularity of the platform
36+
2. Using a well adopted standard may lead to less chance of Markdown renderings not working as intended
37+
2. Cons:
38+
1. GFM is a superset of CommonMark, which may lead to subtle incompatabilities in other renderers that do not
39+
support GFM
40+
41+
## Decision
42+
43+
The team shall use CommonMark to guide all Markdown formatting decisions for the documentation that is generated by the
44+
`docs-readme` output target
45+
46+
## Consequences
47+
48+
- There may be changes in the CommonMark specification, which the team will need to adapt to
49+
- Said changes will likely come as _other_ entities also adopt the changes, e.g. GitHub
50+
- Meaningful changes to certain audiences in the Stencil community (e.g. users of a specific IDE) may be turned away
51+
for not following the spec
52+
- The team should look into tooling around style guides for CommonMark and how they may be integrated into existing
53+
tests
54+
- There may be places where the product does not adhere to CommonMark. Cases of these divergences must be documented
55+
and rectified in the output target
56+
57+
## Links
58+
59+
- [Closed Stencil PR - feat(markdown): improved export to markdown #3042](https://github.com/ionic-team/stencil/pull/3042/)
60+
- [CommonMark Homepage](https://commonmark.org/)
61+
- [GitHub Flavored Markdown (GFM)](https://github.github.com/gfm/)

docs/adr/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
* [9. consuming-app-peer-dependencies](0009-consuming-app-peer-dependencies.md)
1212
* [10. deno-vendoring](0010-deno-vendoring.md)
1313
* [11. karma-testing-constraints](0011-karma-testing-constraints.md)
14+
* [12. output-markdown-format](0012-output-markdown-format.md)

0 commit comments

Comments
 (0)