0.0
No commit activity in last 3 years
No release in over 3 years
Provides an API and an executable to convert Markdown text to BBCode format
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 3.5
 Project Readme

md_to_bbcode

Convert Markdown text to Bbcode

Provides a Ruby API and a command-line executable to convert Markdown text to BBCode format.

Installation

As a prerequisite, you just need to have Ruby installed in your system.

md_to_bbcode installs as any Rubygem, either using gem command or Bundler.

gem install md_to_bbcode

Or using Bundler, add this in your Gemfile and issue bundle install.

gem 'md_to_bbcode'

Usage

Once the gem is installed you can require its main library in your Ruby code and use its API:

require 'md_to_bbcode'

# Convert a String directly
puts 'This is **a bold Markdown text**'.md_to_bbcode
# => This is [b]a bold Markdown text[/b]

The gem also comes with a nice executable that can convert Markdown files to BBCode.

# Display help
md_to_bbcode --help

# Convert a Markdown file into a BBCode file
md_to_bbcode --input original_markdown_file.md --output converted_to_bbcode_file.bbcode

Which Markdown/BBCode flavour is supported?

There are so many flavours of those 2 markup languages that it is impossible to cover them all, but the goal of this project is to add more and more.

The list of supported syntaxes can be seen directly from the test cases.

Developers' corner

Getting the source

Source can be cloned from Github directly, and dependencies are installed with Bundler:

git clone https://github.com/Muriel-Salvan/md_to_bbcode.git
cd md_to_bbcode
bundle install

Running the tests

Tests are done in RSpec. So executing tests is done by:

bundle exec rspec

Packaging

md_to_bbcode is packaged with Rubygem:

gem build md_to_bbcode.gemspec

Versioning

We use SemVer for versioning.

Contributing

Please fork the repository from Github and submit Pull Requests. Any contribution is more than welcome! :D

Authors

License

This project is licensed under the BSD License - see the LICENSE file for details