- smd is human readable. A human with a simple text editor can easily read and comprehend smd.
- smd degrades gracefully. An smd document rendered on
github.com
should be readable and clean.
- Stoplight flavored markdown extends github flavor markdown with inline comment annotations.
- The value inside of the annotations is a yaml object, and the annotation affects the following markdown block.
By leveraging comments to store annotations, Stoplight flavored markdown degrades gracefully to any other markdown renderer (Github, for example).
MDX is an interesting project that might allow our users to add more interactivity to their docs, at the cost of complexity (this is a more advanced use case). We would have to figure out a way to introduce this WITHOUT impacting those users that do not need the feature.
A smd tab container is a tab
annotation, followed by the tab content, and closed by a final tab-end
annotation.
Tab containers cannot be nested.
The contents of tab 1.
The contents of tab 2.
<!--
type: tab
title: My First Tab
-->
The contents of tab 1.
<!--
type: tab
title: My Second Tab
-->
The contents of tab 2.
<!-- type: tab-end -->
A callout is a md block quote with an optional annotation that indicates intent.
Here is my danger callout!
Here is my warning callout!
Here is my success callout!
Here is my info callout
<!-- theme: danger -->
> ### Danger Will Robinson!
>
> Here is my danger callout!
<!-- theme: warning -->
> ### Watch Out!
>
> Here is my warning callout!
<!-- theme: success -->
> ### Mission Accomplished!
>
> Here is my success callout!
<!-- theme: info -->
> ### A thing to know
>
> Here is my info callout
A smd code block is md code fence with an optional annotation to tweak the presentation of the code block.
function fibonacci(num) {
var a = 1,
b = 0,
temp;
while (num >= 0) {
temp = a;
a = a + b;
b = temp;
num--;
}
return b;
}
A smd json schema block is a smd code block with the json_schema
language tag. The contents of the code fence should
be the json schema object to be rendered.
{
"$ref": "../../reference/common/models/error.v1.yaml"
}
A smd http try it out block is a smd code block with the http
language tag. The contents of the code fence should
be the http object to be rendered.
{
"method": "get",
"url": "/gifs/search",
"baseUrl": "http://api.giphy.com/v1",
"headers": {},
"query": {
"api_key": ["dc6zaTOxFJmzC"],
"limit": ["1"],
"q": ["cats"]
}
}
<!-- type: http -->
```json
{
"method": "get",
"url": "/gifs/search",
"baseUrl": "http://api.giphy.com/v1",
"headers": {},
"query": {
"api_key": ["dc6zaTOxFJmzC"],
"limit": ["1"],
"q": ["cats"]
}
}
```
{
"$ref": "../../reference/todos/openapi.v1.json/paths/~1todos/get"
}
<!-- type: http -->
```json
{
"$ref": "../../reference/todos/openapi.v1.json/paths/~1todos/get"
}
```
{
"$ref": "https://stoplight.io/api/nodes.raw?srn=gh/stoplightio/sample-specs/reference/giphy/giphy.yaml/paths/~1gifs~1search/get"
}
<!-- type: http -->
```json
{
"$ref": "https://stoplight.io/api/nodes.raw?srn=gh/stoplightio/sample-specs/reference/giphy/giphy.yaml/paths/~1gifs~1search/get"
}
```
<div>Hello world!</div>
Here is a lot of information!
A smd tab container is a tab
annotation, followed by the tab content, and closed by a final tab-end
annotation.
Tab containers cannot be nested.
The contents of tab 1.
The contents of tab 2.
<!--
type: tab
title: My First Tab
-->
The contents of tab 1.
<!--
type: tab
title: My Second Tab
-->
The contents of tab 2.
<!-- type: tab-end -->
A callout is a md block quote with an optional annotation that indicates intent.
Here is my danger callout!
Here is my warning callout!
Here is my success callout!
Here is my info callout
<!-- theme: danger -->
> ### Danger Will Robinson!
>
> Here is my danger callout!
<!-- theme: warning -->
> ### Watch Out!
>
> Here is my warning callout!
<!-- theme: success -->
> ### Mission Accomplished!
>
> Here is my success callout!
<!-- theme: info -->
> ### A thing to know
>
> Here is my info callout
A smd code block is md code fence with an optional annotation to tweak the presentation of the code block.
function fibonacci(num) {
var a = 1,
b = 0,
temp;
while (num >= 0) {
temp = a;
a = a + b;
b = temp;
num--;
}
return b;
}
A smd json schema block is a smd code block with the json_schema
language tag. The contents of the code fence should
be the json schema object to be rendered.
{
"$ref": "../../reference/common/models/error.v1.yaml"
}
A smd http try it out block is a smd code block with the http
language tag. The contents of the code fence should
be the http object to be rendered.
{
"method": "get",
"url": "/gifs/search",
"baseUrl": "http://api.giphy.com/v1",
"headers": {},
"query": {
"api_key": ["dc6zaTOxFJmzC"],
"limit": ["1"],
"q": ["cats"]
}
}
<!-- type: http -->
```json
{
"method": "get",
"url": "/gifs/search",
"baseUrl": "http://api.giphy.com/v1",
"headers": {},
"query": {
"api_key": ["dc6zaTOxFJmzC"],
"limit": ["1"],
"q": ["cats"]
}
}
```
{
"$ref": "../../reference/todos/openapi.v1.json/paths/~1todos/get"
}
<!-- type: http -->
```json
{
"$ref": "../../reference/todos/openapi.v1.json/paths/~1todos/get"
}
```
{
"$ref": "https://stoplight.io/api/nodes.raw?srn=gh/stoplightio/sample-specs/reference/giphy/giphy.yaml/paths/~1gifs~1search/get"
}
<!-- type: http -->
```json
{
"$ref": "https://stoplight.io/api/nodes.raw?srn=gh/stoplightio/sample-specs/reference/giphy/giphy.yaml/paths/~1gifs~1search/get"
}
```
<div>Hello world!</div>
A smd tab container is a tab
annotation, followed by the tab content, and closed by a final tab-end
annotation.
Tab containers cannot be nested.
The contents of tab 1.
The contents of tab 2.
<!--
type: tab
title: My First Tab
-->
The contents of tab 1.
<!--
type: tab
title: My Second Tab
-->
The contents of tab 2.
<!-- type: tab-end -->
A callout is a md block quote with an optional annotation that indicates intent.
Here is my danger callout!
Here is my warning callout!
Here is my success callout!
Here is my info callout
<!-- theme: danger -->
> ### Danger Will Robinson!
>
> Here is my danger callout!
<!-- theme: warning -->
> ### Watch Out!
>
> Here is my warning callout!
<!-- theme: success -->
> ### Mission Accomplished!
>
> Here is my success callout!
<!-- theme: info -->
> ### A thing to know
>
> Here is my info callout
A smd code block is md code fence with an optional annotation to tweak the presentation of the code block.
function fibonacci(num) {
var a = 1,
b = 0,
temp;
while (num >= 0) {
temp = a;
a = a + b;
b = temp;
num--;
}
return b;
}
A smd json schema block is a smd code block with the json_schema
language tag. The contents of the code fence should
be the json schema object to be rendered.
{
"$ref": "../../reference/common/models/error.v1.yaml"
}
A smd http try it out block is a smd code block with the http
language tag. The contents of the code fence should
be the http object to be rendered.
{
"method": "get",
"url": "/gifs/search",
"baseUrl": "http://api.giphy.com/v1",
"headers": {},
"query": {
"api_key": ["dc6zaTOxFJmzC"],
"limit": ["1"],
"q": ["cats"]
}
}
<!-- type: http -->
```json
{
"method": "get",
"url": "/gifs/search",
"baseUrl": "http://api.giphy.com/v1",
"headers": {},
"query": {
"api_key": ["dc6zaTOxFJmzC"],
"limit": ["1"],
"q": ["cats"]
}
}
```
{
"$ref": "../../reference/todos/openapi.v1.json/paths/~1todos/get"
}
<!-- type: http -->
```json
{
"$ref": "../../reference/todos/openapi.v1.json/paths/~1todos/get"
}
```
{
"$ref": "https://stoplight.io/api/nodes.raw?srn=gh/stoplightio/sample-specs/reference/giphy/giphy.yaml/paths/~1gifs~1search/get"
}
<!-- type: http -->
```json
{
"$ref": "https://stoplight.io/api/nodes.raw?srn=gh/stoplightio/sample-specs/reference/giphy/giphy.yaml/paths/~1gifs~1search/get"
}
```
<div>Hello world!</div>
A smd tab container is a tab
annotation, followed by the tab content, and closed by a final tab-end
annotation.
Tab containers cannot be nested.
The contents of tab 1.
The contents of tab 2.
<!--
type: tab
title: My First Tab
-->
The contents of tab 1.
<!--
type: tab
title: My Second Tab
-->
The contents of tab 2.
<!-- type: tab-end -->
A callout is a md block quote with an optional annotation that indicates intent.
Here is my danger callout!
Here is my warning callout!
Here is my success callout!
Here is my info callout
<!-- theme: danger -->
> ### Danger Will Robinson!
>
> Here is my danger callout!
<!-- theme: warning -->
> ### Watch Out!
>
> Here is my warning callout!
<!-- theme: success -->
> ### Mission Accomplished!
>
> Here is my success callout!
<!-- theme: info -->
> ### A thing to know
>
> Here is my info callout
A smd code block is md code fence with an optional annotation to tweak the presentation of the code block.
function fibonacci(num) {
var a = 1,
b = 0,
temp;
while (num >= 0) {
temp = a;
a = a + b;
b = temp;
num--;
}
return b;
}
A smd json schema block is a smd code block with the json_schema
language tag. The contents of the code fence should
be the json schema object to be rendered.
{
"$ref": "../../reference/common/models/error.v1.yaml"
}
A smd http try it out block is a smd code block with the http
language tag. The contents of the code fence should
be the http object to be rendered.
{
"method": "get",
"url": "/gifs/search",
"baseUrl": "http://api.giphy.com/v1",
"headers": {},
"query": {
"api_key": ["dc6zaTOxFJmzC"],
"limit": ["1"],
"q": ["cats"]
}
}
<!-- type: http -->
```json
{
"method": "get",
"url": "/gifs/search",
"baseUrl": "http://api.giphy.com/v1",
"headers": {},
"query": {
"api_key": ["dc6zaTOxFJmzC"],
"limit": ["1"],
"q": ["cats"]
}
}
```
{
"$ref": "../../reference/todos/openapi.v1.json/paths/~1todos/get"
}
<!-- type: http -->
```json
{
"$ref": "../../reference/todos/openapi.v1.json/paths/~1todos/get"
}
```
{
"$ref": "https://stoplight.io/api/nodes.raw?srn=gh/stoplightio/sample-specs/reference/giphy/giphy.yaml/paths/~1gifs~1search/get"
}
<!-- type: http -->
```json
{
"$ref": "https://stoplight.io/api/nodes.raw?srn=gh/stoplightio/sample-specs/reference/giphy/giphy.yaml/paths/~1gifs~1search/get"
}
```
<div>Hello world!</div>