Skip to content

codebymatt/rosetta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rosetta

A Markdown to HTML translator.

Fair warning

This project is a work in progress; I'm not writing it with other people's production use cases in mind, only mine. I really don't expect anyone else to stumble across this and use it, but if you do then do so at your own peril.

Gem available on rubygems.org

Motivation

I've recently taken an interest in the syntax and semantics of programming languages, and would like to explore some of the practices involved in writing one. Having said that, I don't want to dive into writing a full featured programming language for various reasons, the primary one being that I don't have any use cases where an existing language could not trivially satisfy my programming needs.

With that in mind I've started smaller with a translator that takes Markdown source text and outputs HTML.

At a very high level, Rosetta parses Markdown source into an abstract syntax tree, and then converts that AST into HTML. I've started with a subset of GitHub flavoured Markdown; I use GitHub's Markdown on a near daily basis, and if I want to use this elsewhere I probably won't have need for a full Markdown feature set.

I will only set the Gem version to V1 when I'm happy with the feature set and when tests have been written. If it's not 1.0.0 or greater, it's not finished and is subject to change!

Building and installing

Version is in the format x.y.z

To build the gem:

gem build rosetta-ruby.gemspec

Installing a specific local version (run from the directory the local gem is kept):

gem install ./rosetta-ruby-<version>.gem

Pushing the gem to RubyGems.org:

gem push rosetta-ruby-<version>.gem

Markdown syntax

Rosetta supports the following features. For examples of what these look like in use, visit the GitHub Markdown Guide. I'll mark each item as completed once Rosetta can convert them to its AST representation.

Block level

  • Headers from 1-6
  • Numbered and bulleted lists, as well as sub lists
  • Quotes
  • Standalone code blocks
  • Block URL links
  • Block image embedding

Inline

  • Bold, italic, strikethrough
  • Inline URL links
  • Inline code blocks
  • Inline image embedding

Possible future syntax

  • Superscript
  • Subscript
  • Code block language types

About

A Markdown to HTML translator.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages