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

kramdown-pages

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kramdown-pages

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

kramdown-pages

This gem extends the default kramdown parser with a new block-level element which adds support for embedding Custom Page links in a Markdown document.

Installation

Add this line to your application's Gemfile:

gem 'kramdown-pages'

And then execute:

$ bundle

Or install it yourself as:

$ gem install kramdown-pages

Usage

With standalone kramdown and Rails

  • Ensure you have a Page model that responds to #title and Page::find_by_path, and #path where

    • #title returns the Page title
    • #path returns fully-qualified URL to the page
    • Page::find_by_path returns a Page instance (or nil) given
  • Pass the input option as shown below when initializing a new Kramdown::Document

    Kramdown::Document.new(content, :input => 'KramdownPages')

Syntax

All kramdown supported markup syntax is supported. This gem simply extends the parser to support {page:<permalink>} span-level element. The element will be replaced with an appropriate <a href="page#path">page#title</a> tag.

<permalink> should be replaced with the identifier of the Page you are referencing. The identifier can be hyphenated text, underscored text, or numerical identifier, but cannot contain spaces and special characters. That is, it's regular expression matcher is: [\_\-\/0-9a-zA-Z]+?

Contributing

  1. Fork
  2. Create a topic 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

License

MIT License — see MIT-LICENSE for more information

FAQs

Package last updated on 18 Jan 2016

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