0.0
No commit activity in last 3 years
No release in over 3 years
This plugin provides simple liquid filters to transform a list into a human oriented list
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.2
~> 5.0
~> 13.0
~> 3.10
~> 1.13
 Project Readme

Jekyll::Sanelist

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/jekyll/sanelist.

TODO: Delete this and the text above, and describe your gem

Installation

Add this line to your application's Gemfile:

gem 'jekyll-sanelist'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install jekyll-sanelist

Usage

<html>
    {% assign asanelist = alist | sanelist %}
    {% if asanelist.size == 0 %}
      <!-- Do something for empty list -->
    {% elsif asanelist.size == 1 %}
      <!-- Do something for single-item list -->
    {% elsif asanelist.size > 1 %}
      <!-- Do something for multi-item list -->
    {% endif %}

    {% for element in asanelist %}
        {% case element.type %{
            {% when "item" %}
                <!-- Do someting with element.data in the below block based on where it appears -->
                {% if element.isFirst and element.isLast %}
                {% elsif element.isFirst %}
                {% elsif element.isLast %}
                {% else %}
                {% endif %}

            {% when "delimiter" %}
                <!-- Insert appropriate delimiter in the below block based on where it appears -->
                {% if element.isFirst and element.isLast %}
                {% elsif element.isFirst %}
                {% elsif element.isLast %}
                {% else %}
                {% endif %}
        {% endcase %}
    {% endfor %}
</html>

Development

After checking out the repo, run script/bootstrap to install dependencies. Then, run rake spec to run the tests.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rsampaths16/jekyll-sanelist.

License

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