Giter Club home page Giter Club logo

cmarkdown's Introduction

cMarkdown

Markdown for Python, accelerated by C.

Installation

$ pip install cMarkdown

Usage

>>> import cMarkdown as markdown
>>> markdown.markdown('# Hello, world!')
'<h1>Hello, world!</h1>\n'

Rendering flags

These are keyword arguments to pass to markdown(). They all default to False.

  • skip_html=True: Any HTML in the input will be escaped on output.
  • skip_style=True: Any <style> elements in the input will be escaped on output.
  • skip_images=True: Any <img> elements in the input will be escaped on output.
  • skip_links=True: Any <a> elements in the input will be escaped on output.
  • smartypants=True: Applies smart punctuation transformations.
  • toc=True: Inserts anchors before <h1>, <h2>, et al. for linking in-document from a table of contents.
  • hard_wrap=True: Inserts <br/> tags before newlines in paragraphs.

Markdown extension flags

These keyword arguments to markdown(), which default to False, enable various extensions to the Markdown language.

  • tables=True: Enables a tabular format that renders to <table> in HTML.
  • fenced_code=True: Enables the use of three ``` to delimit the beginning and end of a literal code block.
  • autolink=True: Enables the conversion of bare URLs to links in HTML.
  • strikethrough=True: Enables the use of two ~~ before and after text to wrap it in the <del> tag in HTML.

Credits

Inspired by redcarpet for Ruby. Like with redcarpet, all the hard work is done by the (unfortunately named) upskirt C library. cMarkdown just makes this Markdown parsing and rendering library available to Python.

cmarkdown's People

Contributors

paulsmith avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

fenqinyao

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.