blob: 3af6c6c165a2964f4a802b8917e05e65023c6608 [file] [log] [blame]
David Peekf5d84732013-02-20 09:14:56 +11001// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
Marc Fargasdc110ff2022-03-16 01:31:34 +01005/// Parses text in a Markdown-like format building an
6/// [AST tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree)
7/// that can then be rendered to HTML.
8///
9/// If you are only interested in rendering Markdown to HTML please refer
10/// to the [README](../index.html) which explains the use of [markdownToHtml()].
11///
12/// The main entrypoint to the library is the [Document] which encapsulates the
13/// parsing process converting a Markdown text into a tree of [Node] (`List<Node>`).
14///
15/// Two main parsing mechanics are used:
16///
17/// - Blocks, representing top level elements like: headers, paragraphs, blockquotes,
18/// code blocks, ... implemented via [BlockSyntax] subclasses.
19/// - Inlines, representing chunks of text within a block with special meaning, like:
20/// links, emphasis, inlined code, ... implemented via [InlineSyntax] subclasses.
21///
22/// Looking closely at [Document.new()] a few other concepts merit a mention:
23///
24/// - [ExtensionSet] that provide configurations for common Markdown flavors
25/// - [Resolver] which aid in resolving links and images
26///
27/// If you are looking at extending the library to support custom formatting
28/// what you may want is to:
29///
30/// - Implement your own [InlineSyntax] subclasses
31/// - Implement your own [BlockSyntax] subclasses
32/// - Instruct the library to use those by:
33/// - Creating a new [ExtensionSet] from one of the existing flavors adding your syntaxes
34/// - Passing your syntaxes to [Document] or [markdownToHtml()] as parameters.
David Peekf5d84732013-02-20 09:14:56 +110035library markdown;
36
Kevin Moore95585a92018-10-08 14:02:43 -070037import 'src/version.dart';
38
Kevin Moore659e9c82014-03-06 12:38:29 -080039export 'src/ast.dart';
40export 'src/block_parser.dart';
41export 'src/document.dart';
Valentin Vignal5e6bf7e2021-08-20 03:13:40 +080042export 'src/emojis.dart';
Sam Rawlins7f825bb2015-09-22 15:40:32 -070043export 'src/extension_set.dart';
Kevin Moore659e9c82014-03-06 12:38:29 -080044export 'src/html_renderer.dart';
45export 'src/inline_parser.dart';
Kevin Moore95585a92018-10-08 14:02:43 -070046
47const version = packageVersion;