md_to_html 0.1.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 27

md_to_html

This is a simple transformer that converts all Markdown files into HTML based on a provided template.

To use, add md_to_html to your pubspec:

dependencies:
    md_to_html: ">=0.1.0 <0.2.0"

Then, add the transformer and set the template property to the location of a Mustache-style template:

transformers:
    md_to_html:
        template: "web/template.html"

In the template, the {{content}} tag will be replaced with the generated HTML from your Markdown. You can fill other tags by adding JSON to the beginning of your Markdown file.

For example:

{"title": "My Title"}

## This is a header

This is a paragraph.

With a template:

<html>
<head><title>{{title}}</title></head>
<body>{{content}}</body>
</html>

Would render as:

<html>
<head><title>My Title</title></head>
<body><h2>This is a header</h2>
<p>This is a paragraph.</p></body>
</html>

0.1.0

  • First release

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  md_to_html: "^0.1.0"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


      import 'package:md_to_html/md_to_html.dart';
  
Version Uploaded Documentation Archive
0.1.0 Feb 13, 2015 Go to the documentation of md_to_html 0.1.0 Download md_to_html 0.1.0 archive

Analysis

We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
90 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0 / 100
Overall score:
Weighted score of the above. [more]
27
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:md_to_html/md_to_html.dart.

Suggestions

  • Package is too old.

    The package was released more than two years ago.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use md_to_html.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 4 hints.

    Run dartfmt to format lib/md_to_html.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
barback >=0.15.2+4 <0.16.0 0.15.2+16
markdown >=0.7.1+2 <0.8.0 0.7.2 2.0.0
mustache_no_mirror >=0.1.8 <0.2.0 0.1.8
Transitive dependencies
async 2.0.7
charcode 1.1.1
collection 1.14.10
path 1.6.1
pool 1.3.5
source_span 1.4.0
stack_trace 1.9.2