splitting code into libraries
diff --git a/pkgs/markdown/lib/markdown.dart b/pkgs/markdown/lib/markdown.dart index 33d7c37..e2d6a88 100644 --- a/pkgs/markdown/lib/markdown.dart +++ b/pkgs/markdown/lib/markdown.dart
@@ -5,16 +5,18 @@ /// Parses text in a markdown-like format and renders to HTML. library markdown; -// TODO(rnystrom): Use "package:" URL (#4968). -part 'src/markdown/ast.dart'; -part 'src/markdown/block_parser.dart'; -part 'src/markdown/html_renderer.dart'; -part 'src/markdown/inline_parser.dart'; +import 'src/markdown/ast.dart'; +import 'src/markdown/block_parser.dart'; +import 'src/markdown/html_renderer.dart'; +import 'src/markdown/inline_parser.dart'; + +export 'src/markdown/ast.dart'; +export 'src/markdown/inline_parser.dart'; typedef Node Resolver(String name); /// Converts the given string of markdown to HTML. -String markdownToHtml(String markdown, {inlineSyntaxes, linkResolver, +String markdownToHtml(String markdown, {inlineSyntaxes, linkResolver, bool inlineOnly: false}) { final document = new Document(inlineSyntaxes: inlineSyntaxes, linkResolver: linkResolver);
diff --git a/pkgs/markdown/lib/src/markdown/ast.dart b/pkgs/markdown/lib/src/markdown/ast.dart index c966cea..6a05021 100644 --- a/pkgs/markdown/lib/src/markdown/ast.dart +++ b/pkgs/markdown/lib/src/markdown/ast.dart
@@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -part of markdown; +library markdown.core; /// Base class for any AST item. Roughly corresponds to Node in the DOM. Will /// be either an Element or Text.
diff --git a/pkgs/markdown/lib/src/markdown/block_parser.dart b/pkgs/markdown/lib/src/markdown/block_parser.dart index e83bd64..3c20ab8 100644 --- a/pkgs/markdown/lib/src/markdown/block_parser.dart +++ b/pkgs/markdown/lib/src/markdown/block_parser.dart
@@ -2,7 +2,10 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -part of markdown; +library markdown.block_parser; + +import 'ast.dart'; +import '../../markdown.dart'; /// The line contains only whitespace or is empty. final _RE_EMPTY = new RegExp(r'^([ \t]*)$');
diff --git a/pkgs/markdown/lib/src/markdown/html_renderer.dart b/pkgs/markdown/lib/src/markdown/html_renderer.dart index 5494394..3d79b7a 100644 --- a/pkgs/markdown/lib/src/markdown/html_renderer.dart +++ b/pkgs/markdown/lib/src/markdown/html_renderer.dart
@@ -2,7 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -part of markdown; +library markdown.html_renderer; + +import 'ast.dart'; String renderToHtml(List<Node> nodes) => new HtmlRenderer().render(nodes);
diff --git a/pkgs/markdown/lib/src/markdown/inline_parser.dart b/pkgs/markdown/lib/src/markdown/inline_parser.dart index d141659..f74526f 100644 --- a/pkgs/markdown/lib/src/markdown/inline_parser.dart +++ b/pkgs/markdown/lib/src/markdown/inline_parser.dart
@@ -2,7 +2,10 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -part of markdown; +library markdown.inline_parser; + +import 'ast.dart'; +import '../../markdown.dart'; /// Maintains the internal state needed to parse inline span elements in /// markdown.
diff --git a/pkgs/markdown/test/markdown_test.dart b/pkgs/markdown/test/markdown_test.dart index 91019fe..29d84a3 100644 --- a/pkgs/markdown/test/markdown_test.dart +++ b/pkgs/markdown/test/markdown_test.dart
@@ -6,9 +6,7 @@ library markdownTests; import 'package:unittest/unittest.dart'; - -// TODO(rnystrom): Use "package:" URL (#4968). -import '../lib/markdown.dart'; +import 'package:markdown/markdown.dart'; /// Most of these tests are based on observing how showdown behaves: /// http://softwaremaniacs.org/playground/showdown-highlight/