Git Product home page Git Product logo

toc_list's Introduction

TocList

Convert hash like this:

hash = {'table of content' => [
  {'Platform features' => ['Scalability', 'Fault-tolerance']},
  {'Language features' => ['Functional programming', 'Extensibility and DSLs']},
  {'Tooling features' => ['A growing ecosystem', 'Interactive development', 'Erlang compatible']}]
}

into html list fragment like this (by default):

<div class="toc_container">
    <a href="#table_of_content">table of content</a>
    <ol>
        <li>
            <a href="#Platform_features">Platform features</a>
            <ol>
                <li>
                    <a href="#Scalability">Scalability</a>
                </li>
                <li>
                    <a href="#Fault-tolerance">Fault-tolerance</a>
                </li>
            </ol>
        </li>
        <li>
            <a href="#Language_features">Language features</a>
            <ol>
                <li>
                    <a href="#Functional_programming">Functional programming</a>
                </li>
                <li>
                    <a href="#Extensibility_and_DSLs">Extensibility and DSLs</a>
                </li>
            </ol>
        </li>
        <li>
            <a href="#Tooling_features">Tooling features</a>
            <ol>
                <li>
                    <a href="#A_growing_ecosystem">A growing ecosystem</a>
                </li>
                <li>
                    <a href="#Interactive_development">Interactive development</a>
                </li>
                <li>
                    <a href="#Erlang_compatible">Erlang compatible</a>
                </li>
            </ol>
        </li>
    </ol>
</div>

Installation

Add this line to your application's Gemfile:

gem 'toc_list'

And then execute:

$ bundle

Or install it yourself as:

$ gem install toc_list

Usage

TocList.new(hash).render

License

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

toc_list's People

Contributors

turnon avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.