Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

auto_html

> 编程语言
Open source

Collection of filters that transform plain text into HTML code.

797 stars0 likes3 views
WebsiteGitHub

About

Collection of filters that transform plain text into HTML code.

AutoHtml

AutoHtml is a collection of filters that transforms plain text into HTML code. See live demo.

Installation

Add this line to your application's Gemfile:

ruby
gem 'auto_html'

And then execute:

bash
$ bundle

Or install it yourself as:

bash
$ gem install auto_html

Abstract

AutoHtml uses concepts found in "Pipes and Filters" processing design pattern:

  • Filter - transforms an input. In AutoHtml context, this is any object that does the transformation through #call(String) method. Filter options should be passed in initializer. AutoHtml provides some filters already, ie Link, Image, Markdown, etc.
  • Pipeline - a composition of filters that transforms input by passing the output of one filter as input for the next filter in line. In AutoHtml context, this is the AutoHtml::Pipeline class. Since the same interface (method #call) is used to pass input, we can say that Pipeline is just another Filter, which means it can be used as a building block for other Pipelines, in a mix with other filters.

Examples

…

Bundled filters

Bellow is the list of bundled filters along with their optional arguments on initialization and their default values.

  • AutoHtml::Emoji
  • AutoHtml::HtmlEscape
  • AutoHtml::Image, proxy: nil, alt: nil
  • AutoHtml::Link, target: nil, rel: nil
  • AutoHtml::Markdown
  • AutoHtml::SimpleFormat

Using AutoHtml with ActiveRecord

For performance reasons it's a good idea to store the formated output in the database, in a separate column, to avoid generating the same content on each access. This can be acomplished simply by overriding the attribute writter:

ruby
class Comment  '
Hey!
'

Development

Install dependencies

bash
bundle install

Run Rubocop

bash
rake rubocop

Run tests

bash
rake spec

Licence

AutoHtml is released under the MIT License.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言