Nomenclature Predictably Misunderstood

    ratt

    0.8.1 • Public • Published

    react-all-the-things

    Convert View + template to React component

    const View = require('View');
    const template = require('templates/test');
     
    const view = View.extend({
        init() {
            this.$el.append(template.render());
        }
    });

    +

    <!-- templates/test.html -->
    <div class="layout">
      <div class="title">
        <p>{title}</p>
      </div>
     
      <div class="buttons"></div>
    </div>

    const View = require('View');
     
    const view = View.extend({
        init() {
            this.$el.append((
                <div className="layout">
                  <div className="title">
                    <p>{title}</p>
                  </div>
     
                  <div className="buttons"></div>
                </div>
            ));
        }
    });

    Installation

    npm install -g ratt
    

    Usage

    $ ratt
    Usage: ratt [options] <file>
    
    Options:
      -w, --write           Write result to file instead of printing to stdout
      --templates           Path to templates, default 'platform'
      --externals           Print external references found. Works with .html files only
      -v                    Print version number
    

    Keywords

    none

    Install

    npm i ratt

    DownloadsWeekly Downloads

    6

    Version

    0.8.1

    License

    ISC

    Unpacked Size

    350 kB

    Total Files

    38

    Last publish

    Collaborators

    • miloss