Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

markdown-highlight-extended-filter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-highlight-extended-filter

  • 1.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Markdown Highlight Extended Filter for HTML::Pipeline

An HTML::Pipeline filter to convert Octopress-flavored syntax highlighting, like this:

``` [language] [title] [url] [link text]
code snippet
```

See: http://octopress.org/docs/blogging/code/

Installation

Add this line to your application's Gemfile:

gem 'markdown-highlight-extended-filter'

And then execute:

$ bundle

Or install it without Gemfile (like, Jekyll project):

$ gem install markdown-highlight-extended-filter

Usage

pipeline = HTML::Pipeline.new [
  MarkdownHighlightExtendedFilter,
  HTML::Pipeline::MarkdownFilter
]

pipeline.call(File.read("example.md"))[:output]

example.md:

Here is a sample:

```ruby test.rb
def abc
  123
end
```

Jekyll site usage

This filter is for HTML::Pipeline, so you must use HTML::Pipeline to generate your content from Markdown. See gjtorikian/jekyll-html-pipeline for more details.

Edit _config.yml and configure the pieline like this:

gems:
- jekyll-html-pipeline
- markdown-highlight-extended-filter

markdown: HTMLPipeline

html_pipeline:
  filters:
    - "MarkdownHighlightExtendedFilter" # Must put before markdownfilter
    - "markdownfilter"

Known Issues

Unsupported features:

  • Line Numbers
  • Line Highlights

These were defined in Octopress's document as additional options. (PR welcome!)

Special Thanks

The code to convert complex syntax highlighting was stolen from Octopress Project. See imathis/octopress:plugins/backtick_code_block.rb@73e5404 for the original source code. Also thanks contributers: @imathis, @fhemberger and @liangsun. I hope you don't mind :D

Contributing

  1. Fork it ( https://github.com/chitsaou/markdown-highlight-extended-filter/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

FAQs

Package last updated on 23 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc