popmark, a simple library that populates your markdown files with the output of embedded Dart code segments.
Basic use #
To populate our markdown with the output of embedded code segments, we can run:
This gets popmark to search through the file for code segments marked
dart, execute those segments, and poplate the markdown file with
text blocks containing the respective segment output.
(We can use
--strip to remove all code output blocks.)
Using libraries and packages #
We can use
--imports to specify libraries or packages the code segments rely on.
Alternatively, we can specify a Dart template file, with necessary imports, using
--help for details.
popmark stores a json cache in a folder
.popmark (which we may want to tell our repo to ignore).
We can force popmark to execute code, whether or not it is cached, using
--refresh. (We can also force individual code segments to be executed by wrapping them in code blocks marked
dart! instead of
We can stop popmark from saving a cache, or making changes to an existing cache, using
(We can thus delete the cache by using both
--no-cache, or, of course, by simply running
rm -rf .popmark.)
- Be sure to save the target file before you unleash popmark on it.
- popmark overwrites any blocks marked
text... consider using unmarked blocks for text you do not want modified.
--output output.mdto create a new file rather than overwriting the target.
- If the implementation of the embedded code changes between runs, clear the cache (or mark segments
dart!) to force the segments to be executed.
Thanks for your interest in this project. Please file any issues here.
- Initial version
Use this package as an executable
1. Install it
You can install the package from the command line:
$ pub global activate popmark
2. Use it
The package has the following executables:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Jul 10, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.8.4
- pana: 0.13.14
Cannot assign flutter SDK tag because it is binary only
Cannot assign flutter platform tags, it is a binary only package
Maintenance issues and suggestions
dartdoc successfully runs on your package's source files. (-10 points)
exitCode: 255 stdout: Documenting popmark... Initialized dartdoc with 37 libraries in 30.0 seconds Validating docs... no issues found Documented 0 public libraries in 5.7 seconds stderr: Unhandled exception: dartdoc could not find any libraries to document #0 Dartdoc.generateDocs (package:dartdoc/dartdoc.dart:218:9)
Maintain an example.
None of the files in the package's
example/ directory matches known example patterns.
Common filename patterns include
popmark.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.