Skip to content
Tools for publishing a set of ASCIIdoc files to WordPress
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
lib
spec
.gitignore
.rspec
.travis.yml
CODE_OF_CONDUCT.md
Gemfile
LICENSE.txt
README.md
Rakefile
ascii_press.gemspec

README.md

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.

You can’t perform that action at this time.