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

writedown

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

writedown

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Writedown

Travis Code Climate Code Climate

Writedown is an enhanced renderer for kramdown, the pure Ruby markdown converter.

Installation

Add this line to your application's Gemfile:

gem 'writedown'

Then execute:

bundle

or install it yourself with:

gem install writedown

Usage

After installing the gem, replace instances of Kramdown::Document#to_html in your code with Kramdown::Document#to_writedown.

Features

Asides

You can render asides or "margin notes" using an extended blockquote syntax:

Markdown

> Note:
> Don't forget to turn off the power.

HTML

<aside class="aside aside--note">
  <h4>Note</h4>
  <p>Don't forget to turn off the power.</p>
</aside>

Checkboxes

You can render checkboxes in paragraphs or list items by adding a box to the beginning of the item. Fill the box with an x to have it pre-checked when the page is rendered:

Markdown

- [ ] Buy dog food
- [ ] Pick up laundry
- [x] Pay bills

HTML

<ul>
  <li>
    <p>
      <input type="checkbox" id="checkbox-1" />
      <label for "checkbox-1">Buy dog food</label>
    </p>
  </li>
  <li>
    <p>
      <input type="checkbox" id="checkbox-2" />
      <label for "checkbox-2">Pick up laundry</label>
    </p>
  </li><li>
    <p>
      <input type="checkbox" id="checkbox-3" checked="checked" />
      <label for "checkbox-3">Pay bills</label>
    </p>
  </li>
</ul>

Figures

You can convert an image into an HTML5 figure by placing it on its own line without any other text. Passing a title to the image renders the title as a figure caption:

Markdown

![A still life with fruits and flowers](picture.jpg "Still life")

HTML

<figure>
  <img src="picture.jpg" alt="A still life with fruits and flowers" title="Still life" />
  <figcaption>Still life</figcaption>
</figure>

Image dimensions

If you embed a local image, Writedown uses fastimage to check the image's dimensions and pass them to the HTML:

![](picture.jpg)

HTML

<img src="picture.jpg" alt="" width="640" height="480" />

Contributing

Bug reports and pull requests are welcome.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 18 Jan 2018

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