-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
945 additions
and
725 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ | |
coverage/ | ||
node_modules/ | ||
yarn.lock | ||
!/lib/types.d.ts | ||
!/index.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,315 +1,6 @@ | ||
import type {Info, State} from './lib/types.js' | ||
|
||
/** | ||
* Interface of registered constructs. | ||
* | ||
* When working on extensions that use new constructs, extend the corresponding | ||
* interface to register its name: | ||
* | ||
* ```ts | ||
* declare module 'mdast-util-to-markdown' { | ||
* interface ConstructNameMap { | ||
* // Register a new construct name (value is used, key should match it). | ||
* gfmStrikethrough: 'gfmStrikethrough' | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
export interface ConstructNameMap { | ||
/** | ||
* Whole autolink. | ||
* | ||
* ```markdown | ||
* > | <https://example.com> and <[email protected]> | ||
* ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ | ||
* ``` | ||
*/ | ||
autolink: 'autolink' | ||
/** | ||
* Whole block quote. | ||
* | ||
* ```markdown | ||
* > | > a | ||
* ^^^ | ||
* > | b | ||
* ^ | ||
* ``` | ||
*/ | ||
blockquote: 'blockquote' | ||
/** | ||
* Whole code (indented). | ||
* | ||
* ```markdown | ||
* ␠␠␠␠console.log(1) | ||
* ^^^^^^^^^^^^^^^^^^ | ||
* ``` | ||
*/ | ||
codeIndented: 'codeIndented' | ||
/** | ||
* Whole code (fenced). | ||
* | ||
* ````markdown | ||
* > | ```js | ||
* ^^^^^ | ||
* > | console.log(1) | ||
* ^^^^^^^^^^^^^^ | ||
* > | ``` | ||
* ^^^ | ||
* ```` | ||
*/ | ||
codeFenced: 'codeFenced' | ||
/** | ||
* Code (fenced) language, when fenced with grave accents. | ||
* | ||
* ````markdown | ||
* > | ```js | ||
* ^^ | ||
* | console.log(1) | ||
* | ``` | ||
* ```` | ||
*/ | ||
codeFencedLangGraveAccent: 'codeFencedLangGraveAccent' | ||
/** | ||
* Code (fenced) language, when fenced with tildes. | ||
* | ||
* ````markdown | ||
* > | ~~~js | ||
* ^^ | ||
* | console.log(1) | ||
* | ~~~ | ||
* ```` | ||
*/ | ||
codeFencedLangTilde: 'codeFencedLangTilde' | ||
/** | ||
* Code (fenced) meta string, when fenced with grave accents. | ||
* | ||
* ````markdown | ||
* > | ```js eval | ||
* ^^^^ | ||
* | console.log(1) | ||
* | ``` | ||
* ```` | ||
*/ | ||
codeFencedMetaGraveAccent: 'codeFencedMetaGraveAccent' | ||
/** | ||
* Code (fenced) meta string, when fenced with tildes. | ||
* | ||
* ````markdown | ||
* > | ~~~js eval | ||
* ^^^^ | ||
* | console.log(1) | ||
* | ~~~ | ||
* ```` | ||
*/ | ||
codeFencedMetaTilde: 'codeFencedMetaTilde' | ||
/** | ||
* Whole definition. | ||
* | ||
* ```markdown | ||
* > | [a]: b "c" | ||
* ^^^^^^^^^^ | ||
* ``` | ||
*/ | ||
definition: 'definition' | ||
/** | ||
* Destination (literal) (occurs in definition, image, link). | ||
* | ||
* ```markdown | ||
* > | [a]: <b> "c" | ||
* ^^^ | ||
* > | a ![b](<c> "d") e | ||
* ^^^ | ||
* ``` | ||
*/ | ||
destinationLiteral: 'destinationLiteral' | ||
/** | ||
* Destination (raw) (occurs in definition, image, link). | ||
* | ||
* ```markdown | ||
* > | [a]: b "c" | ||
* ^ | ||
* > | a ![b](c "d") e | ||
* ^ | ||
* ``` | ||
*/ | ||
destinationRaw: 'destinationRaw' | ||
/** | ||
* Emphasis. | ||
* | ||
* ```markdown | ||
* > | *a* | ||
* ^^^ | ||
* ``` | ||
*/ | ||
emphasis: 'emphasis' | ||
/** | ||
* Whole heading (atx). | ||
* | ||
* ```markdown | ||
* > | # alpha | ||
* ^^^^^^^ | ||
* ``` | ||
*/ | ||
headingAtx: 'headingAtx' | ||
/** | ||
* Whole heading (setext). | ||
* | ||
* ```markdown | ||
* > | alpha | ||
* ^^^^^ | ||
* > | ===== | ||
* ^^^^^ | ||
* ``` | ||
*/ | ||
headingSetext: 'headingSetext' | ||
/** | ||
* Whole image. | ||
* | ||
* ```markdown | ||
* > | ![a](b) | ||
* ^^^^^^^ | ||
* > | ![c] | ||
* ^^^^ | ||
* ``` | ||
*/ | ||
image: 'image' | ||
/** | ||
* Whole image reference. | ||
* | ||
* ```markdown | ||
* > | ![a] | ||
* ^^^^ | ||
* ``` | ||
*/ | ||
imageReference: 'imageReference' | ||
/** | ||
* Label (occurs in definitions, image reference, image, link reference, | ||
* link). | ||
* | ||
* ```markdown | ||
* > | [a]: b "c" | ||
* ^^^ | ||
* > | a [b] c | ||
* ^^^ | ||
* > | a ![b][c] d | ||
* ^^^^ | ||
* > | a [b](c) d | ||
* ^^^ | ||
* ``` | ||
*/ | ||
label: 'label' | ||
/** | ||
* Whole link. | ||
* | ||
* ```markdown | ||
* > | [a](b) | ||
* ^^^^^^ | ||
* > | [c] | ||
* ^^^ | ||
* ``` | ||
*/ | ||
link: 'link' | ||
/** | ||
* Whole link reference. | ||
* | ||
* ```markdown | ||
* > | [a] | ||
* ^^^ | ||
* ``` | ||
*/ | ||
linkReference: 'linkReference' | ||
/** | ||
* List. | ||
* | ||
* ```markdown | ||
* > | * a | ||
* ^^^ | ||
* > | 1. b | ||
* ^^^^ | ||
* ``` | ||
*/ | ||
list: 'list' | ||
/** | ||
* List item. | ||
* | ||
* ```markdown | ||
* > | * a | ||
* ^^^ | ||
* > | 1. b | ||
* ^^^^ | ||
* ``` | ||
*/ | ||
listItem: 'listItem' | ||
/** | ||
* Paragraph. | ||
* | ||
* ```markdown | ||
* > | a b | ||
* ^^^ | ||
* > | c. | ||
* ^^ | ||
* ``` | ||
*/ | ||
paragraph: 'paragraph' | ||
/** | ||
* Phrasing (occurs in headings, paragraphs, etc). | ||
* | ||
* ```markdown | ||
* > | a | ||
* ^ | ||
* ``` | ||
*/ | ||
phrasing: 'phrasing' | ||
/** | ||
* Reference (occurs in image, link). | ||
* | ||
* ```markdown | ||
* > | [a][] | ||
* ^^ | ||
* ``` | ||
*/ | ||
reference: 'reference' | ||
/** | ||
* Strong. | ||
* | ||
* ```markdown | ||
* > | **a** | ||
* ^^^^^ | ||
* ``` | ||
*/ | ||
strong: 'strong' | ||
/** | ||
* Title using single quotes (occurs in definition, image, link). | ||
* | ||
* ```markdown | ||
* > | [a](b 'c') | ||
* ^^^ | ||
* ``` | ||
*/ | ||
titleApostrophe: 'titleApostrophe' | ||
/** | ||
* Title using double quotes (occurs in definition, image, link). | ||
* | ||
* ```markdown | ||
* > | [a](b "c") | ||
* ^^^ | ||
* ``` | ||
*/ | ||
titleQuote: 'titleQuote' | ||
} | ||
|
||
/** | ||
* Construct names for things generated by `mdast-util-to-markdown`. | ||
* | ||
* This is an enum of strings, each being a semantic label, useful to know when | ||
* serializing whether we’re for example in a double (`"`) or single (`'`) | ||
* quoted title. | ||
*/ | ||
export type ConstructName = ConstructNameMap[keyof ConstructNameMap] | ||
|
||
export {toMarkdown} from './lib/index.js' | ||
export {handle as defaultHandlers} from './lib/handle/index.js' | ||
export type { | ||
ConstructNameMap, | ||
ConstructName, | ||
Handle, | ||
Handlers, | ||
Info, | ||
|
@@ -321,3 +12,5 @@ export type { | |
Tracker, | ||
Unsafe | ||
} from './lib/types.js' | ||
export {toMarkdown} from './lib/index.js' | ||
export {handle as defaultHandlers} from './lib/handle/index.js' |
Oops, something went wrong.