| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * To use it, from this directory, run: | 6 * To use it, from this directory, run: |
| 7 * | 7 * |
| 8 * $ ./dartdoc <path to .dart file> | 8 * $ ./dartdoc <path to .dart file> |
| 9 * | 9 * |
| 10 * This will create a "docs" directory with the docs for your libraries. To | 10 * This will create a "docs" directory with the docs for your libraries. To |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 : _comments = new CommentMap() { | 101 : _comments = new CommentMap() { |
| 102 // Patch in support for [:...:]-style code to the markdown parser. | 102 // Patch in support for [:...:]-style code to the markdown parser. |
| 103 // TODO(rnystrom): Markdown already has syntax for this. Phase this out? | 103 // TODO(rnystrom): Markdown already has syntax for this. Phase this out? |
| 104 md.InlineParser.syntaxes.insertRange(0, 1, | 104 md.InlineParser.syntaxes.insertRange(0, 1, |
| 105 new md.CodeSyntax(@'\[\:((?:.|\n)*?)\:\]')); | 105 new md.CodeSyntax(@'\[\:((?:.|\n)*?)\:\]')); |
| 106 | 106 |
| 107 md.setImplicitLinkResolver(resolveNameReference); | 107 md.setImplicitLinkResolver(resolveNameReference); |
| 108 } | 108 } |
| 109 | 109 |
| 110 document(String entrypoint) { | 110 document(String entrypoint) { |
| 111 var oldDietParse = options.dietParse; |
| 111 try { | 112 try { |
| 112 var oldDietParse = options.dietParse; | |
| 113 options.dietParse = true; | 113 options.dietParse = true; |
| 114 | 114 |
| 115 // Handle the built-in entrypoints. | 115 // Handle the built-in entrypoints. |
| 116 switch (entrypoint) { | 116 switch (entrypoint) { |
| 117 case 'corelib': | 117 case 'corelib': |
| 118 world.getOrAddLibrary('dart:core'); | 118 world.getOrAddLibrary('dart:core'); |
| 119 world.getOrAddLibrary('dart:coreimpl'); | 119 world.getOrAddLibrary('dart:coreimpl'); |
| 120 world.getOrAddLibrary('dart:json'); | 120 world.getOrAddLibrary('dart:json'); |
| 121 world.process(); | 121 world.process(); |
| 122 break; | 122 break; |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 | 841 |
| 842 return new md.Element.text('code', name); | 842 return new md.Element.text('code', name); |
| 843 } | 843 } |
| 844 | 844 |
| 845 // TODO(rnystrom): Move into SourceSpan? | 845 // TODO(rnystrom): Move into SourceSpan? |
| 846 int getSpanColumn(SourceSpan span) { | 846 int getSpanColumn(SourceSpan span) { |
| 847 final line = span.file.getLine(span.start); | 847 final line = span.file.getLine(span.start); |
| 848 return span.file.getColumn(line, span.start); | 848 return span.file.getColumn(line, span.start); |
| 849 } | 849 } |
| 850 } | 850 } |
| OLD | NEW |