Skip to content

Latest commit

 

History

History
1494 lines (1134 loc) · 42.2 KB

readme-ko.md

File metadata and controls

1494 lines (1134 loc) · 42.2 KB

mdast

Markdown Abstract Syntax Tree.


mdast구문 트리에서 마크다운을 표현하기 위한 사양입니다. unist 를 구현합니다. CommonMarkGitHub Flavored Markdown과 같은 여러 마크다운 종류를 표현할 수 있습니다.

이 문서는 아직 릴리스되지 않았을 수 있습니다. 릴리스된 문서는 releases를 참조하세요. 최신 릴리스 버전은 5.0.0입니다.

목차

소개

이 문서는 [마크다운][]을 추상 구문 트리로 표현하는 형식을 정의합니다. mdast의 개발은 2014년 7월 remark 에서 시작되었으며, 이는 unist가 존재하기 전이었습니다. 이 사양은 Web IDL과 유사한 문법으로 작성되었습니다.

이 사양의 적용 범위

mdast는 unist를 확장하여 구문 트리를 확장하여, 유틸리티 생태계의 이점을 얻습니다.

mdast는 JavaScript와 관련이 있습니다. JavaScript에서 호환되는 구문 트리를 다루기 위한 풍부한 유틸리티 생태계가 있기 때문입니다. 그러나 mdast는 JavaScript에 국한되지 않으며 다른 프로그래밍 언어에서도 사용될 수 있습니다.

mdast는 unifiedremark 프로젝트와 관련이 있습니다. mdast 구문 트리가 이들의 생태계 전반에 걸쳐 사용되기 때문입니다.

타입

TypeScript를 사용하는 경우, npm을 통해 unist 타입을 설치하여 사용할 수 있습니다:

npm install @types/mdast

노드 (추상)

Literal

interface Literal <: UnistLiteral {
  value: string
}

Literal (UnistLiteral)은 mdast에서 값을 포함하는 추상 인터페이스를 나타냅니다.

value 필드는 string 타입입니다.

Parent

interface Parent <: UnistParent {
  children: [MdastContent]
}

Parent (UnistParent)는 mdast에서 다른 노드를 포함하는 추상 인터페이스를 나타냅니다 (이를 자식이라고 합니다).

그 내용은 mdast 콘텐츠로만 제한됩니다.

노드

Blockquote

interface Blockquote <: Parent {
  type: 'blockquote'
  children: [FlowContent]
}

Blockquote (Parent)는 다른 곳에서 인용된 섹션을 나타냅니다.

Blockquote흐름 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델도 흐름 콘텐츠입니다.

예를 들어, 다음과 같은 마크다운은:

> Alpha bravo charlie.

다음과 같이 변환됩니다:

{
  type: 'blockquote',
  children: [{
    type: 'paragraph',
    children: [{type: 'text', value: 'Alpha bravo charlie.'}]
  }]
}

Break

interface Break <: Node {
  type: 'break'
}

Break (Node)는 시(poems)나 주소에서와 같은 줄 바꿈을 나타냅니다.

Break구문 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 콘텐츠 모델이 없습니다.

예를 들어, 다음과 같은 마크다운은:

foo··
bar

다음과 같이 변환됩니다:

{
  type: 'paragraph',
  children: [
    {type: 'text', value: 'foo'},
    {type: 'break'},
    {type: 'text', value: 'bar'}
  ]
}

Code

interface Code <: Literal {
  type: 'code'
  lang: string?
  meta: string?
}

Code (Literal)는 ASCII 아트나 컴퓨터 코드와 같은 미리 형식화된 텍스트 블록을 나타냅니다.

Code흐름 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 내용은 value 필드로 표현됩니다.

이 노드는 구문 콘텐츠 개념인 InlineCode와 관련이 있습니다.

lang 필드가 존재할 수 있습니다. 이는 마크업되는 컴퓨터 코드의 언어를 나타냅니다.

lang 필드가 존재하는 경우, meta 필드도 존재할 수 있습니다. 이는 노드와 관련된 사용자 정의 정보를 나타냅니다.

예를 들어, 다음과 같은 마크다운은:

    foo()

다음과 같이 변환됩니다:

{
  type: 'code',
  lang: null,
  meta: null,
  value: 'foo()'
}

그리고 다음과 같은 마크다운은:

```js highlight-line="2"
foo();
bar();
baz();
```

다음과 같이 변환됩니다:

{
  type: 'code',
  lang: 'javascript',
  meta: 'highlight-line="2"',
  value: 'foo()\nbar()\nbaz()'
}

Definition

interface Definition <: Node {
  type: 'definition'
}

Definition includes Association
Definition includes Resource

Definition (Node)은 리소스를 나타냅니다.

Definition콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 콘텐츠 모델이 없습니다.

DefinitionAssociationResource 믹스인을 포함합니다.

DefinitionLinkReferencesImageReferences와 연관되어야 합니다.

예를 들어, 다음과 같은 마크다운은:

[Alpha]: https://example.com

다음과 같이 변환됩니다:

{
  type: 'definition',
  identifier: 'alpha',
  label: 'Alpha',
  url: 'https://example.com',
  title: null
}

Emphasis

interface Emphasis <: Parent {
  type: 'emphasis'
  children: [PhrasingContent]
}

Emphasis (Parent)는 그 내용의 강조를 나타냅니다.

Emphasis구문 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델은 구문 콘텐츠입니다.

예를 들어, 다음과 같은 마크다운은:

_alpha_ _bravo_

다음과 같이 변환됩니다:

{
  type: 'paragraph',
  children: [
    {
      type: 'emphasis',
      children: [{type: 'text', value: 'alpha'}]
    },
    {type: 'text', value: ' '},
    {
      type: 'emphasis',
      children: [{type: 'text', value: 'bravo'}]
    }
  ]
}

Heading

interface Heading <: Parent {
  type: 'heading'
  depth: 1 <= number <= 6
  children: [PhrasingContent]
}

Heading (Parent)은 섹션의 제목을 나타냅니다.

Heading흐름 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델은 구문 콘텐츠입니다.

depth 필드가 존재해야 합니다. 1의 값은 가장 높은 순위를 나타내고 6은 가장 낮은 순위를 나타냅니다.

예를 들어, 다음과 같은 마크다운은:

# Alpha

다음과 같이 변환됩니다:

{
  type: 'heading',
  depth: 1,
  children: [{type: 'text', value: 'Alpha'}]
}

Html

interface Html <: Literal {
  type: 'html'
}

Html (Literal)은 원시 HTML 조각을 나타냅니다.

Html흐름 또는 구문 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 내용은 value 필드로 표현됩니다.

Html 노드는 유효하거나 완전한 HTML ([HTML]) 구조일 필요는 없습니다.

예를 들어, 다음과 같은 마크다운은:

<div>

다음과 같이 변환됩니다:

{type: 'html', value: '<div>'}

Image

interface Image <: Node {
  type: 'image'
}

Image includes Resource
Image includes Alternative

Image (Node)는 이미지를 나타냅니다.

Image구문 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 콘텐츠 모델은 없지만, alt 필드로 설명됩니다.

ImageResourceAlternative 믹스인을 포함합니다.

예를 들어, 다음과 같은 마크다운은:

![alpha](https://example.com/favicon.ico "bravo")

다음과 같이 변환됩니다:

{
  type: 'image',
  url: 'https://example.com/favicon.ico',
  title: 'bravo',
  alt: 'alpha'
}

ImageReference

interface ImageReference <: Node {
  type: 'imageReference'
}

ImageReference includes Reference
ImageReference includes Alternative

ImageReference (Node)는 연관을 통해 이미지를 나타내거나, 연관이 없는 경우 원본 소스를 나타냅니다.

ImageReference구문 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 콘텐츠 모델은 없지만, alt 필드로 설명됩니다.

ImageReferenceReferenceAlternative 믹스인을 포함합니다.

ImageReferenceDefinition과 연관되어야 합니다.

예를 들어, 다음과 같은 마크다운은:

![alpha][bravo]

다음과 같이 변환됩니다:

{
  type: 'imageReference',
  identifier: 'bravo',
  label: 'bravo',
  referenceType: 'full',
  alt: 'alpha'
}

InlineCode

interface InlineCode <: Literal {
  type: 'inlineCode'
}

InlineCode (Literal)는 파일 이름, 컴퓨터 프로그램 또는 컴퓨터가 구문 분석할 수 있는 모든 것과 같은 컴퓨터 코드 조각을 나타냅니다.

InlineCode구문 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 내용은 value 필드로 표현됩니다.

이 노드는 흐름 콘텐츠 개념인 Code와 관련이 있습니다.

예를 들어, 다음과 같은 마크다운은:

`foo()`

다음과 같이 변환됩니다:

{type: 'inlineCode', value: 'foo()'}

Link

interface Link <: Parent {
  type: 'link'
  children: [PhrasingContent]
}

Link includes Resource

Link (Parent)는 하이퍼링크를 나타냅니다.

Link구문 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델도 구문 콘텐츠입니다.

LinkResource 믹스인을 포함합니다.

예를 들어, 다음과 같은 마크다운은:

[alpha](https://example.com "bravo")

다음과 같이 변환됩니다:

{
  type: 'link',
  url: 'https://example.com',
  title: 'bravo',
  children: [{type: 'text', value: 'alpha'}]
}

LinkReference

interface LinkReference <: Parent {
  type: 'linkReference'
  children: [PhrasingContent]
}

LinkReference includes Reference

LinkReference (Parent)는 연관을 통해 하이퍼링크를 나타내거나, 연관이 없는 경우 원본 소스를 나타냅니다.

LinkReference구문 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델도 구문 콘텐츠입니다.

LinkReferenceReference 믹스인을 포함합니다.

LinkReferencesDefinition과 연관되어야 합니다.

예를 들어, 다음과 같은 마크다운은:

[alpha][Bravo]

다음과 같이 변환됩니다:

{
  type: 'linkReference',
  identifier: 'bravo',
  label: 'Bravo',
  referenceType: 'full',
  children: [{type: 'text', value: 'alpha'}]
}

List

interface List <: Parent {
  type: 'list'
  ordered: boolean?
  start: number?
  spread: boolean?
  children: [ListContent]
}

List (Parent)는 항목의 목록을 나타냅니다.

List흐름 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델은 목록 콘텐츠입니다.

ordered 필드가 존재할 수 있습니다. 이는 true인 경우 항목들이 의도적으로 순서가 지정되었음을 나타냅니다. 또는 false이거나 존재하지 않는 경우 항목의 순서가 중요하지 않음을 나타냅니다.

start 필드가 존재할 수 있습니다. 이는 ordered 필드가 true일 때, 목록의 시작 번호를 나타냅니다.

spread 필드가 존재할 수 있습니다. 이는 하나 이상의 자식이 형제와 빈 줄로 구분되어 있음을 나타냅니다 (true인 경우), 또는 그렇지 않음을 나타냅니다 (false이거나 존재하지 않는 경우).

예를 들어, 다음과 같은 마크다운은:

1. foo

다음과 같이 변환됩니다:

{
  type: 'list',
  ordered: true,
  start: 1,
  spread: false,
  children: [{
    type: 'listItem',
    spread: false,
    children: [{
      type: 'paragraph',
      children: [{type: 'text', value: 'foo'}]
    }]
  }]
}

ListItem

interface ListItem <: Parent {
  type: 'listItem'
  spread: boolean?
  children: [FlowContent]
}

ListItem (Parent)는 List의 항목을 나타냅니다.

ListItem목록 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델은 흐름 콘텐츠입니다.

spread 필드가 존재할 수 있습니다. 이는 true인 경우 항목이 빈 줄로 구분된 두 개 이상의 자식을 포함하고 있음을 나타냅니다. 또는 false이거나 존재하지 않는 경우 그렇지 않음을 나타냅니다.

예를 들어, 다음과 같은 마크다운은:

- bar

다음과 같이 변환됩니다:

{
  type: 'listItem',
  spread: false,
  children: [{
    type: 'paragraph',
    children: [{type: 'text', value: 'bar'}]
  }]
}

Paragraph

interface Paragraph <: Parent {
  type: 'paragraph'
  children: [PhrasingContent]
}

Paragraph (Parent)는 특정 주제나 아이디어를 다루는 단락의 단위를 나타냅니다.

Paragraph콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델은 구문 콘텐츠입니다.

예를 들어, 다음과 같은 마크다운은:

Alpha bravo charlie.

다음과 같이 변환됩니다:

{
  type: 'paragraph',
  children: [{type: 'text', value: 'Alpha bravo charlie.'}]
}

Root

interface Root <: Parent {
  type: 'root'
}

Root (Parent)는 문서를 나타냅니다.

Root트리루트로 사용될 수 있으며, 절대 자식으로 사용될 수 없습니다. 그 콘텐츠 모델은 흐름 콘텐츠로 제한되지 않지만, 대신 모든 mdast 콘텐츠를 포함할 수 있으며, 모든 콘텐츠가 동일한 카테고리여야 한다는 제한이 있습니다.

Strong

interface Strong <: Parent {
  type: 'strong'
  children: [PhrasingContent]
}

Strong (Parent)는 그 내용에 대한 강한 중요성, 심각성 또는 긴급성을 나타냅니다.

Strong구문 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델은 구문 콘텐츠입니다.

예를 들어, 다음과 같은 마크다운은:

**alpha** **bravo**

다음과 같이 변환됩니다:

{
  type: 'paragraph',
  children: [
    {
      type: 'strong',
      children: [{type: 'text', value: 'alpha'}]
    },
    {type: 'text', value: ' '},
    {
      type: 'strong',
      children: [{type: 'text', value: 'bravo'}]
    }
  ]
}

Text

interface Text <: Literal {
  type: 'text'
}

Text (Literal)는 단순히 텍스트인 모든 것을 나타냅니다.

Text구문 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 내용은 value 필드로 표현됩니다.

예를 들어, 다음과 같은 마크다운은:

Alpha bravo charlie.

다음과 같이 변환됩니다:

{type: 'text', value: 'Alpha bravo charlie.'}

ThematicBreak

interface ThematicBreak <: Node {
  type: 'thematicBreak'
}

ThematicBreak (Node)는 이야기의 장면 전환, 다른 주제로의 전환 또는 새로운 문서와 같은 주제별 구분을 나타냅니다.

ThematicBreak흐름 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 콘텐츠 모델이 없습니다.

예를 들어, 다음과 같은 마크다운은:

---

다음과 같이 변환됩니다:

{
  type: "thematicBreak";
}

믹스인

Alternative

interface mixin Alternative {
  alt: string?
}

Alternative는 대체 내용이 있는 노드를 나타냅니다.

alt 필드가 존재해야 합니다. 이는 노드를 의도한 대로 표현할 수 없는 환경에 대한 동등한 내용을 나타냅니다.

Association

interface mixin Association {
  identifier: string
  label: string?
}

Association은 한 노드에서 다른 노드로의 내부 관계를 나타냅니다.

identifier 필드가 존재해야 합니다. 이는 다른 노드와 일치할 수 있습니다. identifier는 소스 값입니다: 문자 이스케이프와 문자 참조는 파싱되지 않습니다. 그 값은 정규화되어야 합니다.

label 필드가 존재할 수 있습니다. label은 문자열 값입니다: 링크의 title이나 코드의 lang과 마찬가지로 작동합니다: 문자 이스케이프와 문자 참조가 파싱됩니다.

값을 정규화하려면 마크다운 공백([\t\n\r ]+)을 공백으로 축소하고, 선택적 초기 및/또는 최종 공백을 제거하며, 대소문자 접기를 수행합니다.

identifier의 값(또는 identifier가 없는 경우 정규화된 label)이 고유 식별자여야 하는지 여부는 Association을 포함하는 노드의 유형에 따라 다릅니다. 예를 들어, Definition에서는 고유해야 하지만, 여러 LinkReference는 하나의 정의와 연관되기 위해 고유하지 않을 수 있습니다.

Reference

interface mixin Reference {
  referenceType: string
}

Reference includes Association

Reference는 다른 노드와 연관된 마커를 나타냅니다.

referenceType 필드가 존재해야 합니다. 그 값은 referenceType이어야 합니다. 이는 참조의 명시성을 나타냅니다.

Resource

interface mixin Resource {
  url: string
  title: string?
}

Resource는 리소스에 대한 참조를 나타냅니다.

url 필드가 존재해야 합니다. 이는 참조된 리소스에 대한 URL을 나타냅니다.

title 필드가 존재할 수 있습니다. 이는 리소스에 대한 조언 정보를 나타내며, 툴팁에 적합할 수 있습니다.

열거형

referenceType

enum referenceType {
  'shortcut' | 'collapsed' | 'full'
}

referenceType은 참조의 명시성을 나타냅니다.

  • shortcut: 참조가 암시적이며, 식별자가 그 내용에서 추론됩니다.
  • collapsed: 참조가 명시적이며, 식별자가 그 내용에서 추론됩니다.
  • full: 참조가 명시적이며, 식별자가 명시적으로 설정됩니다.

컨텐츠 모델

type MdastContent = FlowContent | ListContent | PhrasingContent

mdast의 각 노드는 유사한 특성을 가진 노드들을 그룹화하는 하나 이상의 Content 카테고리에 속합니다.

Content

type Content = Definition | Paragraph

Content는 정의와 단락을 형성하는 텍스트의 실행을 나타냅니다.

FlowContent

type FlowContent =
  Blockquote | Code | Heading | Html | List | ThematicBreak | Content

Flow 콘텐츠는 문서의 섹션을 나타냅니다.

ListContent

type ListContent = ListItem

List 콘텐츠는 목록의 항목을 나타냅니다.

PhrasingContent

type PhrasingContent = Break | Emphasis | Html | Image | ImageReference
  | InlineCode | Link | LinkReference | Strong | Text

Phrasing 콘텐츠는 문서의 텍스트와 그 마크업을 나타냅니다.

확장

마크다운 구문은 종종 확장됩니다. 이 명세의 목표는 모든 가능한 확장을 나열하는 것이 아닙니다. 그러나 자주 사용되는 확장의 짧은 목록이 아래에 나와 있습니다.

GFM

다음 인터페이스들은 GitHub Flavored Markdown에서 찾을 수 있습니다.

Delete

interface Delete <: Parent {
  type: 'delete'
  children: [PhrasingContent]
}

Delete (Parent)는 더 이상 정확하지 않거나 더 이상 관련이 없는 내용을 나타냅니다.

Delete구문 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델은 구문 콘텐츠입니다.

예를 들어, 다음과 같은 마크다운은:

~~alpha~~

다음과 같이 변환됩니다:

{
  type: 'delete',
  children: [{type: 'text', value: 'alpha'}]
}

ListItem (GFM)

interface ListItemGfm <: ListItem {
  checked: boolean?
}

GFM에서는 checked 필드가 존재할 수 있습니다. 이는 항목이 완료되었는지(true일 때), 완료되지 않았는지(false일 때), 또는 결정되지 않았거나 해당 사항이 없는지(null이거나 존재하지 않을 때)를 나타냅니다.

FootnoteDefinition

interface FootnoteDefinition <: Parent {
  type: 'footnoteDefinition'
  children: [FlowContent]
}

FootnoteDefinition includes Association

FootnoteDefinition (Parent)는 문서의 흐름 외부에 있는 문서와 관련된 내용을 나타냅니다.

FootnoteDefinition흐름 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델도 흐름 콘텐츠입니다.

FootnoteDefinitionAssociation 믹스인을 포함합니다.

FootnoteDefinitionFootnoteReferences와 연관되어야 합니다.

예를 들어, 다음과 같은 마크다운은:

[^alpha]: bravo and charlie.

다음과 같이 변환됩니다:

{
  type: 'footnoteDefinition',
  identifier: 'alpha',
  label: 'alpha',
  children: [{
    type: 'paragraph',
    children: [{type: 'text', value: 'bravo and charlie.'}]
  }]
}

FootnoteReference

interface FootnoteReference <: Node {
  type: 'footnoteReference'
}

FootnoteReference includes Association

FootnoteReference (Node)는 연관을 통한 마커를 나타냅니다.

FootnoteReference구문 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 콘텐츠 모델이 없습니다.

FootnoteReferenceAssociation 믹스인을 포함합니다.

FootnoteReferenceFootnoteDefinition과 연관되어야 합니다.

예를 들어, 다음과 같은 마크다운은:

[^alpha]

다음과 같이 변환됩니다:

{
  type: 'footnoteReference',
  identifier: 'alpha',
  label: 'alpha'
}

Table

interface Table <: Parent {
  type: 'table'
  align: [alignType]?
  children: [TableContent]
}

Table (Parent)는 2차원 데이터를 나타냅니다.

Table흐름 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델은 테이블 콘텐츠입니다.

노드의 헤더는 열의 레이블을 나타냅니다.

align 필드가 존재할 수 있습니다. 존재하는 경우, alignType의 목록이어야 합니다. 이는 열의 셀들이 어떻게 정렬되는지를 나타냅니다.

예를 들어, 다음과 같은 마크다운은:

| foo | bar |
| :-- | :-: |
| baz | qux |

다음과 같이 변환됩니다:

{
  type: 'table',
  align: ['left', 'center'],
  children: [
    {
      type: 'tableRow',
      children: [
        {
          type: 'tableCell',
          children: [{type: 'text', value: 'foo'}]
        },
        {
          type: 'tableCell',
          children: [{type: 'text', value: 'bar'}]
        }
      ]
    },
    {
      type: 'tableRow',
      children: [
        {
          type: 'tableCell',
          children: [{type: 'text', value: 'baz'}]
        },
        {
          type: 'tableCell',
          children: [{type: 'text', value: 'qux'}]
        }
      ]
    }
  ]
}

TableCell

interface TableCell <: Parent {
  type: 'tableCell'
  children: [PhrasingContent]
}

TableCell (Parent)는 Table의 헤더 셀을 나타냅니다, 만약 그 부모가 헤더인 경우, 그렇지 않으면 데이터 셀을 나타냅니다.

TableCell 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델은 Break 노드를 제외한 구문 콘텐츠입니다.

예시는 Table을 참조하세요.

TableRow

interface TableRow <: Parent {
  type: 'tableRow'
  children: [RowContent]
}

TableRow (Parent)는 테이블의 셀 행을 나타냅니다.

TableRow테이블 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 콘텐츠 모델은 콘텐츠입니다.

노드가 헤더인 경우, 부모 Table의 열 레이블을 나타냅니다.

예시는 Table을 참조하세요.

alignType

enum alignType {
  'left' | 'right' | 'center' | null
}

alignType은 구문 콘텐츠가 어떻게 정렬되는지를 나타냅니다 ([CSSTEXT]).

  • 'left': text-align CSS 속성의 left 값 참조
  • 'right': text-align CSS 속성의 right 값 참조
  • 'center': text-align CSS 속성의 center 값 참조
  • null: 구문 콘텐츠가 호스트 환경에 의해 정의된 대로 정렬됨

FlowContent (GFM)

type FlowContentGfm = FootnoteDefinition | Table | FlowContent

ListContent (GFM)

type ListContentGfm = ListItemGfm

PhrasingContent (GFM)

type PhrasingContentGfm = FootnoteReference | Delete | PhrasingContent

RowContent

type RowContent = TableCell

Row 콘텐츠는 행의 셀을 나타냅니다.

TableContent

type TableContent = TableRow

Table 콘텐츠는 테이블의 행을 나타냅니다.

Frontmatter

다음 인터페이스들은 YAML에서 찾을 수 있습니다.

Yaml

interface Yaml <: Literal {
  type: 'yaml'
}

Yaml (Literal)은 YAML ([YAML]) 데이터 직렬화 언어로 작성된 문서의 메타데이터 컬렉션을 나타냅니다.

Yamlfrontmatter 콘텐츠가 예상되는 곳에서 사용할 수 있습니다. 그 내용은 value 필드로 표현됩니다.

예를 들어, 다음과 같은 마크다운은:

---
foo: bar
---

다음과 같이 변환됩니다:

{type: 'yaml', value: 'foo: bar'}

FrontmatterContent

type FrontmatterContent = Yaml

Frontmatter 콘텐츠는 문서에 대한 대역 외 정보를 나타냅니다.

frontmatter가 존재하는 경우, 트리에서 하나의 노드로 제한되어야 하며, 헤더로만 존재할 수 있습니다.

FlowContent (frontmatter)

type FlowContentFrontmatter = FrontmatterContent | FlowContent

MDX

remark-mdx를 참조하세요.

용어집

unist 용어집을 참조하세요.

유틸리티 목록

더 많은 유틸리티는 unist 유틸리티 목록을 참조하세요.

참고 문헌

보안

mdast는 HTML을 포함할 수 있고 HTML을 표현하는 데 사용될 수 있으므로, HTML의 부적절한 사용이 크로스 사이트 스크립팅 (XSS) 공격에 노출될 수 있듯이 mdast의 부적절한 사용도 안전하지 않습니다. HTML로 변환할 때 (일반적으로 hast를 통해), 항상 사용자 입력에 주의하고 hast-util-santize를 사용하여 hast 트리를 안전하게 만드세요.

관련 항목

  • hast — 하이퍼텍스트 추상 구문 트리 형식
  • nlcst — 자연어 구체 구문 트리 형식
  • xast — 확장 가능한 추상 구문 트리

기여

시작하는 방법은 syntax-tree/.githubcontributing.md를 참조하세요. 도움을 받는 방법은 support.md를 참조하세요. 새로운 유틸리티와 도구에 대한 아이디어는 syntax-tree/ideas에 게시할 수 있습니다.

멋진 syntax-tree, unist, mdast, hast, xast, nlcst 리소스의 큐레이션된 목록은 awesome syntax-tree에서 찾을 수 있습니다.

이 프로젝트에는 행동 강령이 있습니다. 이 저장소, 조직 또는 커뮤니티와 상호 작용함으로써 귀하는 해당 약관을 준수하는 것에 동의합니다.

감사의 말

이 프로젝트의 초기 릴리스는 @wooorm에 의해 작성되었습니다.

@eush77의 작업, 아이디어, 그리고 믿을 수 없이 귀중한 피드백에 특별히 감사드립니다!

다음 분들께도 감사드립니다: @anandthakker, @arobase-che, @BarryThePenguin, @chinesedfan, @ChristianMurphy, @craftzdog, @d4rekanguok, @detj, @dominictarr, @gkatsev, @Hamms, @Hypercubed, @ikatyang, @izumin5210, @jasonLaster, @Justineo, @justjake, @KyleAMathews, @laysent, @macklinu, @mike-north, @Murderlon, @nevik, @Rokt33r, @rhysd, @rubys, @Sarah-Seo, @sethvincent, @silvenon, @simov, @staltz, @stefanprobst, @tmcw, 그리고 @vhf mdast와 관련 프로젝트에 기여해 주셔서 감사합니다!

라이선스

CC-BY-4.0 © Titus Wormer