将博客园的备份文章转换为markdown格式
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
spec
.gitignore
.rspec
.travis.yml
CODE_OF_CONDUCT.md
Gemfile
LICENSE.txt
README.md
Rakefile
cnblog_back_up_to_markdown.gemspec

README.md

Summary

Gem Version Build Status codecov.io

Convert cnblog bakcup to markdown or markdown file.

Github: https://github.com/haoxilu/cnblog_back_up_to_markdown

Ruby Gem: https://rubygems.org/gems/cnblog_back_up_to_markdown

Requirements

  1. Nokogiri
  2. Ruby 1.9.3 or higher

Installation

Add this line to your application's Gemfile:

gem 'cnblog_back_up_to_markdown'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cnblog_back_up_to_markdown

Usage

Ruby

require

require 'cnblog_back_up_to_markdown'

use

file_path = File.expand_path("app/controllers/CNBlogs_BlogBackup_131_201311_201602.xml")
File.open(file_path) do |f|
  @articles = CnblogBackUpToMarkdown::convert(f)
end

CommandLine

It's also possible to convert cnblog's backup file to mrakdown using this library.

cnblog_parser convert CNBlogs_BlogBackup_131_201311_201602.xml

License

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