GithubHelp home page GithubHelp logo

hypermark's Introduction

Hypermark!

Markdown is Hypertext.

Inspirational, fast, reversible, extendable, and filterable.

เฅ

Current Usage

>>> import hypermark

>>> content = "# fuck yea\nhttp://github.com"

>>> d = hypermark.text(content)
'<HyperText 7c7706acb8>'

>>> d.links
['http://github.com']

>>> d.hash
u'03a392ef91826a3506fcc54a4e1fa7b022688ec42bc4d53b4c36a8b6f8058606'

>>> print(d.html)
<h1>fuck yea</h1>
<p><a href="http://github.com">http://github.com</a></p>

Convert HTML to Markdown!

>>> print(hypermark.html('<h1>test h1</h1>'))
# test h1

Filters!

>>> print(d.filter('bleach').html)
&lt;h1&gt;fuck yea&lt;/h1&gt;
&lt;p&gt;<a href="http://github.com">http://github.com</a>&lt;/p&gt;


>>> print(d.filter('transpose_headers', levels=1).html)
<h2>fuck yea</h2>
<p><a href="http://github.com">http://github.com</a></p>

>>> print(d.filter('anchors').html)
<h1 id="toc-1">fuck yea</h1>
<p><a href="http://github.com">http://github.com</a></p>

Vision (Work in Progress)

Feature ideas:

  1. link extraction
  2. diff generation
  3. sha generation
  4. md->html, html->md
  5. header transposing
  6. stripping?
  7. targets for headers

This could, potentially, contain a lot of the basic functionality of wikis.org itself โ€” would help explain the core concepts to the world, perhaps.

hypermark's People

Contributors

kennethreitz avatar akshatm avatar sintrastes avatar lurst avatar lepture avatar

Watchers

James Cloos 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.