The project is in a healthy, maintained state
Middleware to render Markdown Documents in Nexmo Developer Platform.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

~> 3.31
~> 0.8.15
~> 13.0
~> 3.9
~> 0.16

Runtime

~> 0.1.2
~> 1.7
~> 1.10
~> 3.4
~> 2.0.7
 Project Readme

Nexmo Markdown Renderer

Build Status MIT licensed

This gem facilitates the presentation of markdown documents in a Rails app by applying custom filters for tabs, code snippets, icons, indentation and more. It is used in the Nexmo Developer Platform.

  • Installation and Usage
    • In An Application
    • CLI Standlone
  • Contributing
  • License

Installation and Usage

In An Application

To use this gem you must install it in your application's Gemfile:

gem 'nexmo-markdown-renderer'

Then run bundle install to install it.

The gem requires an environment variable to be set of DOCS_BASE_PATH that should point to the top level directory of your markdown content to be rendered. For example:

DOCS_BASE_PATH = '/path/to/markdown`

Once you have installed it, you can use it by instantiating an instance of it by passing in the options you require:

content = Nexmo::Markdown::Renderer.new()

Once you have instantiated an instance, you can then invoke the #call method with the markdown you wish to render. You can either point to a file or pass in the markdown directly:

Passing in the markdown directly:

rendered = content.call( "with markdown" )

Passing in a markdown file:

rendered = content.call("/_documentation/example/example_markdown.md")

CLI Standalone

To use the markdown renderer with the built-in CLI, you first must install the gem locally:

$ gem install nexmo-markdown-renderer

Once the gem is installed you can use the CLI to generate HTML output for a provided markdown file. To do so, you must specify both a path to the documentation folder and the specific markdown file you wish to render:

$ DOCS_BASE_PATH=path/to/docs bundle exec nexmo-markdown-renderer render _documentation/path/sample.md

The converted HTML output will be displayed in your console.

Contributing

We ❤️ contributions from everyone! Bug reports, bug fixes and feedback on the gem is always appreciated. Look at the Contributor Guidelines for more information.

License

This project is under the MIT LICENSE