Skip to content

This gem is built to take a template and replace its keys with the specified content.

License

Notifications You must be signed in to change notification settings

oasis4hedev/template_chips

Repository files navigation

Template Chips

This gem is built to take a template and replace its keys with the specified content.

A template should always be html, and the keys should be css identifiers, and the content should be html safe.

Installation

gem 'template_chips'

or

$ gem install template_chips

Usage

template_html
...
<div>
    <h1>
        <div id="title"></div>
    </h1>

    <p>
        <span id="description"></span>   
    </p>
</div>
chips processor
...
output = Chips::Template::Processor.new(
    template_html,
    mortises: {
        'title': '#title',
        'desc': '#description'
    },
    tenons: {
        'title': 'Hello World!',
        'desc': 'lorem ipsum'
    }
).generate()
output
...
<div>
    <h1>
        Hello World!
    </h1>

    <p>
        lorem ispum   
    </p>
</div>

Development

TODO: Put something here

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/template_chips.

License

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

About

This gem is built to take a template and replace its keys with the specified content.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published