Coder Social home page Coder Social logo

ktsuench / markdown-to-pug Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexandremasy/markdown-to-pug

0.0 2.0 0.0 122 KB

Markdown to PugJS converter

Home Page: https://alexandremasy.github.io/markdown-to-pug/

License: MIT License

JavaScript 100.00%

markdown-to-pug's Introduction

Markdown To PugJS

Convert your Markdown to PugJS

https://alexandremasy.github.io/markdown-to-pug/

CircleCI

Why?

Sometimes you like the simplicity of markdown to just express whatever you want to say, but want to keep control on how it will look like. This is what it is about, get control over the output while adding simple ways to take advantage of the PugJS functionalities like mixins and layout.

Install

NodeJS

npm --save install markdown-to-pug

or

yarn add markdown-to-pug

Dependencies

API

constructor(options)

Parameters

Property Type Description
options Object An object with the options.

Options

Option Description
newline Newline definition. Default value: \n
space Space definition. Default value: \t
linkify Allow the use of Linkify by MarkdownIt. Default value: true
typographer Allow the use of Typographer by MarkdownIt. Default value: true
langPrefix Prefix to use to generate class on code block. Default value: language-

.render(src)

Parameters

Property Type Description
src String The Markdown you like to convert

Return

Type Description
String The PugJS String

.md

The instance of markdown-it. Use it to add plugin support.

Example

var md2pug = new (require('markdown-to-pug'))();

var md = `![Stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat")`;
var pug = md2pug.render(md);

Mixin support

With the folliwing PugJS mixin

mixin list
  ul
    li first
    li second
    li third    
<!-- +list -->

Layout support

<!-- extends layout.pug -->

<!-- block content -->
# Title

will yield to

extend layout.pug

block content
  h1 Title

markdown-to-pug's People

Contributors

alexandremasy avatar ktsuench avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.