Repository is archived
No commit activity in last 3 years
No release in over 3 years
将博客园备份xml文件通过命令转为markdown文件,或者将博客园备份xml直接转为可以调用的对象
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 10.0
~> 3.4
~> 0.19.1

Runtime

 Project Readme

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.