Socket
Book a DemoInstallSign in
Socket

gulp-md-template

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-md-template

Include markdown files in an HTML template

1.1.4
latest
Source
npmnpm
Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

gulp-md-template

NPM Version Build Status Dependency Status

Gulp plugin uses markdown-templator to include markdown files in an HTML template.

Installation

$ npm install gulp-md-template

Gulpfile

var gulp = require('gulp'),
    template = require('gulp-md-template');

gulp.task('default', function () {
    return gulp.src('./*.html')
      .pipe(template('./partials'))
      .pipe(gulp.dest('./dist'));
});

Example Usage

You can include markdown files into an HTML template so that this:

<!-- ./index.html -->

<head>
  <title>Example</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  {{header}}
  <div class="container">
    {{article.md}}
  </div>
</body>
<!-- ./partials/header.md -->

![Logo](logo.png)
## TITLE
<!-- ./partials/article.md -->

This is an article about this stuff:

- Item of intereset
- Another item of interest
- An item of non-interest

Transforms to this:

<!-- ./dist/index.html -->

<head>
  <title>Example</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <p><img src="logo.png" alt="Logo"></p>
<h2 id="title">TITLE</h2>

  <div class="container">
    <p>This is an article about this stuff:</p>
<ul>
<li>Item of intereset</li>
<li>Another item of interest</li>
<li>An item of non-interest</li>
</ul>

  </div>
</body>

How to contribute

  • File an issue in the repository, using the bug tracker, describing the contribution you'd like to make. This will help us to get you started on the right foot.
  • Fork the project in your account and create a new branch: your-great-feature.
  • Commit your changes in that branch.
  • Open a pull request, and reference the initial issue in the pull request message.

License

See the LICENSE file.

FAQs

Package last updated on 10 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.