dart_markdown 3.1.7
A portable Markdown library written in Dart that can parse Markdown into AST and HTML.
Developer Tools
This directory contains tools for developers of the Dart markdown package.
dartdoc_compare.dart
When you make a change to the package that might have subtle consequences on how Markdown is parsed, it would be really great to see how your output compares to the previous output, on a large collection of Markdown.
One such collection is the Dartdoc comments of any Dart package, which dartdoc
translates into HTML, with the help of this markdown package. You can use the
dartdoc_compare.dart script to compare what changes your code will make to
dartdoc's output. Here's how it works:
-
Clone the dartdoc git repository.
-
Get a copy of some Dart code that you would like to use for the comparison.
-
Run the
dartdoc_compare.dartscript like so:$ dart tool/dartdoc_compare.dart \ --dartdoc-dir=<dartdoc repo> \ --before=<git SHA of "previous" code> \ <directory of dart code for comparison> -
The tool will then walk through the following steps:
- cd into the dartdoc directory, change
pubspec.yamlto depend on your "before" version of markdown, and runpub get. - cd into the directory of dart code, and run
pub get. - Run dartdoc.
- cd back into the dartdoc directory, change
pubspec.yamlto depend on your "after" version of markdown (defaults to HEAD), and runpub get. - Repeat steps 2 and 3.
- Diff the output of steps 3 and 5, and show you how to diff it yourself.
- cd into the dartdoc directory, change
stats.dart
In an effort to make this package CommonMark-compliant, we have a script that runs the package through the CommonMark specs. To see help:
$ dart tool/stats.dart --help