Giter Site home page Giter Site logo

helpers / helper-markdown Goto Github PK

View Code? Open in Web Editor NEW
39.0 7.0 23.0 24 KB

Markdown template helper. Uses remarkable to render markdown in templates. Should work with Handlebars, Lo-Dash or any template engine that supports helper functions.

License: MIT License

JavaScript 100.00%
markdown helper handlebars register javascript

helper-markdown's People

Contributors

almeidap avatar doowb avatar jonschlinkert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

helper-markdown's Issues

Can't get to work with content from expression

I want to pass content from a variable into the markdown helper, something like this but it doesn't work?

{{#markdown}}{{myContent}}{{/markdown}}

I'm guessing I need some other kind of syntax?

Upgrade for new packages

Hi is it posible to upgrade this package to newer version of related plugins for example-> depricated package -> highlight.js

First line always renders as <pre><code>

If the first line in my markdown doesn't start with a \n , then the {{#markdown}} {{/markdown}} tags renders it as <pre><code>

Example

This text ### Marlene Dietrich gets rendered as <pre><code>Marlene Dietrich</code></pre> instead of <h3>Marlene Dietrich</h3>

However if the text starts with a \n it will render with the h3 tags.
Same with pics, paragraphs, etc.
Please help.

Using YAML front matter with markdown helper renders first line as code

description

I am running assemble with gulp, and in my settings, no matter what I write in the first line, it will always be interpreted as if I was writing code.

Expected behaviour

Renders the first line of the content of the markdown as a headline, or whatever syntax was used in there.

Actual behaviour

It renders the first line of the .md file as a code block

<pre><code>    # In progress
</code></pre>

version

0.2.1

Markdown file

---
title: Roadmap

---

# In progress

Layout

  {{#markdown}}
      {% body %}
  {{/markdown}}

Markdown to AMP

It's me again... I was wondering if there is a feature for this plugin to convert markdown to AMP. For example, for my current blog the markdown I pull for images gets parsed into <img> while I need them to be parsed into <amp-img>

If it is not possible with this plugin, could you please recommend a solution/trick I could use ? Thank you!

TypeError when using helper-markdown with Handlebars

When registering helper-markdown with Handlebars:

module.exports.register = function (handlebars) {
    handlebars.registerHelper('markdown', require('helper-markdown'));
};

...the following exception is thrown:

[...]\node_modules\mixin-deep\index.js:30
    this[key] = val;
              ^
TypeError: Cannot set property parent of [object Object] which has only a getter
    at Buffer.copy ([...]\node_modules\mixin-deep\index.js:30:15)
    at forIn ([...]\node_modules\for-in\index.js:12:12)
    at mixinDeep ([...]\node_modules\mixin-deep\index.js:11:7)
    at File.copy ([...]\node_modules\mixin-deep\index.js:28:5)
    at forIn ([...]\node_modules\for-in\index.js:12:12)
    at mixinDeep ([...]\node_modules\mixin-deep\index.js:11:7)
    at Object.copy ([...]\node_modules\mixin-deep\index.js:28:5)
    ...

This looks to be the faulty source code line:

options = merge({ html: true, breaks: true }, config, options);

(cf.

options = merge({ html: true, breaks: true }, config, options);
)

Commenting L36 fixes the exception and helper-markdown works then as expected.

Is there a way to enable rules? deflists etc

I wan't to use deflists in my markdown files.
Remarkable doesn't enable them by default. And the toggle is outside of options object.
I'm looking either for a way to access the rule switches or a way to instantiate Remarkable with the "full" config instead of "default".

(Using helper-markdown from assemble.)

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.