Project

codemerger

0.0
No commit activity in last 3 years
No release in over 3 years
This gem is used to help writing technical posts for wordpress. \ The output is copied and pasted to a post into my wordpress blog, and the code gets colored using the plugin wp-syntax, and the output can be turned into PDF with the plugin wp-mpdf. Today this gem supports source files in the following languages: * Ruby (including Rakefile and Gemfile) * Java * YAML * HTML * XML * Scala * CSS * Javascript * Bash * Batch All other files are configured as "text".
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

= 1.3.3
= 2.0.0b3
 Project Readme

This gem is used to help writing technical posts for wordpress.

To use this GEM I usually create a new directory for the post or post group project, then I create a Gemfile like this:

    source "http://rubygems.org"
    group :rake do
      gem "codemerger", "0.1.0", :require => "codemerger/rake_tasks"
    end

After that I create a Rakefile like this:

    require "rubygems"
    require "bundler/setup"
    Bundler.require :rake

Then just start creating the post file in the root directory, the project supports .html or .markdown files for the posts. Inside this file, when I want to include a source sample, I create another file for the sample, and then I include it into the main post file with a code like this:

    {{full/path/to/the/file.rb}}

When the post is ready I run teh rake task:

    rake codemerger:merge

After that, the file I was writting is processed, a new file is created into the output directory and the sample source files are included with a code like this:

    <b>{{full/path/to/the/file.rb}}</b>
    <pre line="1" lang="ruby">
      ruby code
    </pre>

This snippet is then copied and pasted to a post into my wordpress blog, and the code gets colored using the plugin wp-syntax, and the output can be turned into PDF with the plugin wp-mpdf.

Today this gem supports source files in the following languages:

  • Ruby (including Rakefile and Gemfile)
  • Java
  • YAML
  • HTML
  • XML
  • Scala
  • CSS
  • Javascript
  • Bash
  • Batch

All other files are configured as "text".

For the next steps I'm planning to write more automated tests, refactor the language support code out, today it is a switch statement to convert from a file extension to a name supported by wp-syntax/Geshi and add support for templates and direct conversion of the source samples to colored HTML.

All these changes are simple, but besides the automated tests, I do not need any of the other right now, if you think they will be usefull for you, send me a message, file an enhancement request or fork, implement and send me a pull request.

Any testing or comments will be of great value, today, I think only I'm using this GEM.