Skip to content

slack project markupdown 2020 02 03

akabeko edited this page Feb 15, 2020 · 1 revision

2020-02-03

Time (UTC) Icon Name Message
03:19 uetchy 確かに。これはImageタグのデフォルトHTMLにしても良いですね
03:19 uetchy https://github.com/vivliostyle/vfm/blob/master/spec/vfm.md#image
# Vivliostyle Flavored Markdown: Working Draft

Vivliostyle Flavored Markdown (VFM), a Markdown syntax optimized for book authoring. It is standardized and published for Vivliostyle and its sibling projects.

## Principles

1. Open discussion - steadily improving through open discussion and feedback from the vast community.
1. Provides reference implementation for parsing and converting VFM to HTML, allowing other non-Vivliostyle projects to use this syntax for their own purposes.

### VFM

1. Rule of least surprise
- Should be lined and matched to another Markdown syntax.
1. Not intended to be a superset/subset of either CommonMark or GFM.
1. Backward compatible syntax (should not be incorrectly rendered in Markdown editor like Typora).

### HTML

- Follows WCAG 2.1.

## Spec

### Caveats

- position is omitted in mdast.

### Sentence

- A newline puts <br/> to the end of a line.
- Consecutive 2 newlines creates new sentence block.

VFM
md
はじめまして。

Vivliostyle Flavored Markdown(略して VFM)の世界へようこそ。
VFM は出版物の執筆に適した Markdown 方言であり、Vivliostyle プロジェクトのために策定・実装されました。

mdast
json
[
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "はじめまして。"
}
]
},
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "Vivliostyle Flavored Markdown(略して VFM)の世界へようこそ。"
},
{
"type": "break"
},
{
"type": "text",
"value": "VFM は出版物の執筆に適した Markdown 方言であり、Vivliostyle プロジェクトのために策定・実装されました。"
}
]
}
]

HTML
html
<p>はじめまして。</p>
<p>
Vivliostyle Flavored Markdown(略して VFM)の世界へようこそ。<br />
VFM は出版物の執筆に適した Markdown 方言であり、Vivliostyle
プロジェクトのために策定・実装されました。
</p>

### Heading

VFM
md
# Heading 1

## Heading 2

### Heading 3

#### Heading 4

##### Heading 5

###### Heading 6

mdast
json
{
"type": "heading",
"depth": 1,
"children": [
{
"type": "text",
"value": "Heading 1"
}
]
}

...

{
"type": "heading",
"depth": 6,
"children": [
{
"type": "text",
"value": "Heading 6"
}
]
}

HTML
html
<h1>Heading 1</h1>
...
<h6>Heading 6</h6>

### Code

VFM
md<br>```javascript:app.js<br>function main() {}<br><pre>

mdast
json
{
"type": "code",
"lang": "javascript",
"meta": {
"title": "app.js"
},
"value": "function main() {}"
}

HTML
html
<pre>
<code class="language-javascript">
function main() {}
</code>
</pre>

#### Dictionary-style metadata

VFM
md<br>```javascript:title=app.js<br>function main() {}<br><pre>

mdast
json
{
"type": "code",
"lang": "javascript",
"meta": {
"title": "app.js"
},
"value": "function main() {}"
}

HTML
html
<pre>
<code class="language-javascript">
function main() {}
</code>
</pre>

### Ruby

VFM

This is [Ruby]{ルビ}

mdast
json
{
"type": "ruby",
"rubyText": "ルビ",
"children": [
{
"type": "text",
"value": "Ruby"
}
]
}

HTML
html
This is <ruby>Ruby<rt>ルビ</rt></ruby>

#### Other candidates

##### `{電子出版
03:19 Kiara Translation 🇬🇧: surely. This may be the default HTML for the Image tag
03:19 Kiara Translation 🇬🇧: https://github.com/vivliostyle/vfm/blob/master/spec/vfm.md#image
🇯🇵: https://github.com/vivliostyle/vfm/blob/master/spec/vfm.md#image
Clone this wiki locally