Giter VIP home page Giter VIP logo

markable's Introduction

Markable

Build Status

Markable provides Janet bindings for GitHub's fork of the CommonMark library, cmark-gfm.

Requirements

Markable includes commands to compile cmark-gfm from source. As such, your system needs to meet the requirements for cmark-gfm.

Installation

Add the dependency to your project.janet file:

(declare-project
  :dependencies ["https://github.com/pyrmont/markable"])

Then run:

$ jpm deps

Usage

Markable provides the function (markdown->html str &opt opts exts).

It can be used like this:

(import markable)

(markable/markdown->html "Hello **world**") # => "<p>Hello <strong>world</strong></p>\n"

The opts and exts arguments are optional.

opts can be a tuple containing one or more of the following keywords:

:footnotes         Parse footnotes.
:full-info-string  Include the remainder of the info string in code blocks in
                   a separate attribute.
:github-pre-lang   Use GitHub-style tags for code blocks.
:hardbreaks        Render soft breaks (newlines inside paragraphs in the
                   CommonMark source) as hard line breaks in the target format.
                   If this option is specified, hard wrapping is disabled for
                   CommonMark output.
:liberal-html-tag  Be liberal in interpreting inline HTML tags.
:nobreaks          Render soft breaks as spaces. If this option is specified,
                   hard wrapping is disabled for all output formats
:smart             Use smart punctuation. Straight double and single quotes
                   will be rendered as curly quotes, depending on their
                   position, -- will be rendered as an en-dash, --- will be
                   rendered as an em-dash and ... will be rendered as ellipses.
:sourcepos         Include the source position attribute.
:unsafe            Render raw HTML or potentially dangerous URLs. (Raw HTML is
                   replaced by a placeholder comment; potentially dangerous
                   URLs are replaced by empty strings.) Dangerous URLs are
                   those that begin with javascript:, vbscript:, file:, or
                   data: (except for image/png, image/gif, image/jpeg, or
                   image/webp mime types).
:validate-utf8     Validate UTF-8, replacing illegal sequences with U+FFFD.

The following options can also be set but depend on extensions being enabled:

:strikethrough-double-tilde     Only parse strikethroughs if surrounded by
                                exactly two tildes.
:table-prefer-style-attributes  Use style attributes to align table cells
                                instead of align attributes.

exts can be a tuple containing one or more of the following keywords: :autolink, :tasklist, :strikethrough, :table, :tagfilter and :tasklist. More details about each extension is available in the GitHub Flavored Markdown Spec.

Bugs

Found a bug? I'd love to know about it. The best way is to report your bug in the Issues section on GitHub.

Licence

Markable is licensed under the MIT Licence. See LICENSE for more details.

markable's People

Contributors

pyrmont avatar sogaiu avatar

Watchers

 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.