0.0
No commit activity in last 3 years
No release in over 3 years
Tools for publishing a set of ASCIIdoc files to WordPress
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.0
~> 0.36.0

Runtime

~> 1.5.4
>= 0.7.7
~> 1.1.1
 Project Readme

AsciiPress

AsciiPress is a gem which is designed to make it easy to publish a set of asciidoc files to a specific post_type in a WordPress site. You can see an example in action in the render.rb file to generate the Neo4j developer website.

Installation

Add this line to your application's Gemfile:

gem 'ascii_press'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ascii_press

Usage

The main API to synchronize documents with WordPress in the WordPressSyncer. To create a new WordPressSyncer you need to provide a hostname, username, password, and a AsciiPress::Renderer object. The following is an example:

WP_HOSTNAME = 'fakepress.com'
WP_USERNAME = 'fake'
WP_PASSWORD = 'pass'
WP_POST_TYPE = 'faq'

renderer = AsciiPress::Renderer.new(tags_proc: -> (rendering) { rendering.tags + ['tag-for-all'] },
                                    asciidoc_options: {attributes: 'allow-uri-read'})

syncer = AsciiPress::WordPressSyncer.new(WP_HOSTNAME, WP_USERNAME, WP_PASSWORD, renderer, WP_POST_TYPE
                                         post_type: ENV['BLOG_POST_TYPE'],
                                         logger: LOGGER,
                                         delete_not_found: delete_not_found,
                                         generate_tags: true,
                                         filter_proc: filter_proc)

adoc_file_paths = `find . -name "*.adoc"`.split(/[\n\r]+/)
syncer.sync(adoc_file_paths)

See the API documentation for more details on arguments and options

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ascii_press. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

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