Update docs to mention new way to minify. Fixes #39

This commit is contained in:
JC Brand 2013-08-20 22:53:19 +02:00
parent 304b275714
commit b7ecf39982
9 changed files with 65 additions and 80 deletions

View File

@ -106,7 +106,7 @@ module.exports = function(grunt) {
}); });
}); });
grunt.registerTask('minify', 'Create a new release', ['requirejs', 'cssmin']); grunt.registerTask('minify', 'Create a new release', ['cssmin', 'requirejs']);
grunt.registerTask('check', 'Perform all checks (e.g. before releasing)', function () { grunt.registerTask('check', 'Perform all checks (e.g. before releasing)', function () {
grunt.task.run('jshint', 'test'); grunt.task.run('jshint', 'test');

2
converse.min.js vendored

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -542,40 +542,27 @@ be used.
Minification Minification
============ ============
Minifying Javascript Minifying Javascript and CSS
==================== ============================
Please make sure to read the section `Development`_ and that you have installed
all development dependencies (long story short, you can run ``npm install``
and then ``grunt fetch``).
We use `require.js`_ to keep track of *Converse.js* and its dependencies and to We use `require.js`_ to keep track of *Converse.js* and its dependencies and to
to bundle them together in a single minified file fit for deployment to a to bundle them together in a single minified file fit for deployment to a
production site. production site.
To use the require.js's optimization tool, you'll need Node and it's package To minify the Javascript and CSS, run the following command:
manager, NPM.
You can then install install require.js for Node like so:
:: ::
npm install requirejs grunt minify
The minified javascript file is then created like this:
::
r.js -o build.js
You should now have a new minified file (the name which is specified in build.js).
Javascript will be bundled and minified via `require.js`_'s optimization tool.
You can `read more about require.js's optimizer here`_. You can `read more about require.js's optimizer here`_.
Minifying CSS CSS is minified via `cssmin <https://github.com/gruntjs/grunt-contrib-cssmin>`_.
=============
CSS can be minimized with Yahoo's yuicompressor tool:
::
yui-compressor --type=css converse.css -o converse.min.css
============ ============

View File

@ -32,4 +32,11 @@ h1 a {
ul { ul {
margin-bottom: 5px; margin-bottom: 5px;
}
tt.literal {
color: #222;
background-color: #fff;
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
font-size: 14px;
} }

View File

@ -99,18 +99,18 @@
<li><a class="reference internal" href="#auto-list-rooms" id="id23">auto_list_rooms</a></li> <li><a class="reference internal" href="#auto-list-rooms" id="id23">auto_list_rooms</a></li>
<li><a class="reference internal" href="#auto-subscribe" id="id24">auto_subscribe</a></li> <li><a class="reference internal" href="#auto-subscribe" id="id24">auto_subscribe</a></li>
<li><a class="reference internal" href="#bosh-service-url" id="id25">bosh_service_url</a></li> <li><a class="reference internal" href="#bosh-service-url" id="id25">bosh_service_url</a></li>
<li><a class="reference internal" href="#fullname" id="id26">fullname</a></li> <li><a class="reference internal" href="#debug" id="id26">debug</a></li>
<li><a class="reference internal" href="#hide-muc-server" id="id27">hide_muc_server</a></li> <li><a class="reference internal" href="#fullname" id="id27">fullname</a></li>
<li><a class="reference internal" href="#prebind" id="id28">prebind</a></li> <li><a class="reference internal" href="#hide-muc-server" id="id28">hide_muc_server</a></li>
<li><a class="reference internal" href="#show-controlbox-by-default" id="id29">show_controlbox_by_default</a></li> <li><a class="reference internal" href="#prebind" id="id29">prebind</a></li>
<li><a class="reference internal" href="#xhr-user-search" id="id30">xhr_user_search</a></li> <li><a class="reference internal" href="#show-controlbox-by-default" id="id30">show_controlbox_by_default</a></li>
<li><a class="reference internal" href="#xhr-user-search" id="id31">xhr_user_search</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</li> </li>
<li><a class="reference internal" href="#minification" id="id31">Minification</a><ul> <li><a class="reference internal" href="#minification" id="id32">Minification</a><ul>
<li><a class="reference internal" href="#minifying-javascript" id="id32">Minifying Javascript</a></li> <li><a class="reference internal" href="#minifying-javascript-and-css" id="id33">Minifying Javascript and CSS</a></li>
<li><a class="reference internal" href="#minifying-css" id="id33">Minifying CSS</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference internal" href="#translations" id="id34">Translations</a></li> <li><a class="reference internal" href="#translations" id="id34">Translations</a></li>
@ -444,20 +444,24 @@ option will create lots of extra connection traffic.</p>
a middle man between HTTP and XMPP.</p> a middle man between HTTP and XMPP.</p>
<p>See <a class="reference external" href="http://metajack.im/2008/09/08/which-bosh-server-do-you-need">here</a> for more information.</p> <p>See <a class="reference external" href="http://metajack.im/2008/09/08/which-bosh-server-do-you-need">here</a> for more information.</p>
</div> </div>
<div class="section" id="debug">
<h3><a class="toc-backref" href="#id26">debug</a><a class="headerlink" href="#debug" title="Permalink to this headline"></a></h3>
<p>If set to true, debugging output will be logged to the browser console.</p>
</div>
<div class="section" id="fullname"> <div class="section" id="fullname">
<h3><a class="toc-backref" href="#id26">fullname</a><a class="headerlink" href="#fullname" title="Permalink to this headline"></a></h3> <h3><a class="toc-backref" href="#id27">fullname</a><a class="headerlink" href="#fullname" title="Permalink to this headline"></a></h3>
<p>If you are using prebinding, you need to specify the fullname of the currently <p>If you are using prebinding, you need to specify the fullname of the currently
logged in user.</p> logged in user.</p>
</div> </div>
<div class="section" id="hide-muc-server"> <div class="section" id="hide-muc-server">
<h3><a class="toc-backref" href="#id27">hide_muc_server</a><a class="headerlink" href="#hide-muc-server" title="Permalink to this headline"></a></h3> <h3><a class="toc-backref" href="#id28">hide_muc_server</a><a class="headerlink" href="#hide-muc-server" title="Permalink to this headline"></a></h3>
<p>Default = False</p> <p>Default = False</p>
<p>Hide the <tt class="docutils literal"><span class="pre">server</span></tt> input field of the form inside the <tt class="docutils literal"><span class="pre">Room</span></tt> panel of the <p>Hide the <tt class="docutils literal"><span class="pre">server</span></tt> input field of the form inside the <tt class="docutils literal"><span class="pre">Room</span></tt> panel of the
controlbox. Useful if you want to restrict users to a specific XMPP server of controlbox. Useful if you want to restrict users to a specific XMPP server of
your choosing.</p> your choosing.</p>
</div> </div>
<div class="section" id="prebind"> <div class="section" id="prebind">
<h3><a class="toc-backref" href="#id28">prebind</a><a class="headerlink" href="#prebind" title="Permalink to this headline"></a></h3> <h3><a class="toc-backref" href="#id29">prebind</a><a class="headerlink" href="#prebind" title="Permalink to this headline"></a></h3>
<p>Default = False</p> <p>Default = False</p>
<p>Use this option when you want to attach to an existing XMPP connection that was <p>Use this option when you want to attach to an existing XMPP connection that was
already authenticated (usually on the backend before page load).</p> already authenticated (usually on the backend before page load).</p>
@ -478,7 +482,7 @@ have to write a Javascript snippet to attach to the set up connection:</p>
RID (Request ID), which you use when you attach to the connection.</p> RID (Request ID), which you use when you attach to the connection.</p>
</div> </div>
<div class="section" id="show-controlbox-by-default"> <div class="section" id="show-controlbox-by-default">
<h3><a class="toc-backref" href="#id29">show_controlbox_by_default</a><a class="headerlink" href="#show-controlbox-by-default" title="Permalink to this headline"></a></h3> <h3><a class="toc-backref" href="#id30">show_controlbox_by_default</a><a class="headerlink" href="#show-controlbox-by-default" title="Permalink to this headline"></a></h3>
<p>Default = False</p> <p>Default = False</p>
<p>The &#8220;controlbox&#8221; refers to the special chatbox containing your contacts roster, <p>The &#8220;controlbox&#8221; refers to the special chatbox containing your contacts roster,
status widget, chatrooms and other controls.</p> status widget, chatrooms and other controls.</p>
@ -488,7 +492,7 @@ the page with class <em>toggle-online-users</em>.</p>
page load.</p> page load.</p>
</div> </div>
<div class="section" id="xhr-user-search"> <div class="section" id="xhr-user-search">
<h3><a class="toc-backref" href="#id30">xhr_user_search</a><a class="headerlink" href="#xhr-user-search" title="Permalink to this headline"></a></h3> <h3><a class="toc-backref" href="#id31">xhr_user_search</a><a class="headerlink" href="#xhr-user-search" title="Permalink to this headline"></a></h3>
<p>Default = False</p> <p>Default = False</p>
<p>There are two ways to add users.</p> <p>There are two ways to add users.</p>
<ul class="simple"> <ul class="simple">
@ -501,28 +505,21 @@ be used.</p>
</div> </div>
</div> </div>
<div class="section" id="minification"> <div class="section" id="minification">
<h1><a class="toc-backref" href="#id31">Minification</a><a class="headerlink" href="#minification" title="Permalink to this headline"></a></h1> <h1><a class="toc-backref" href="#id32">Minification</a><a class="headerlink" href="#minification" title="Permalink to this headline"></a></h1>
<div class="section" id="minifying-javascript"> <div class="section" id="minifying-javascript-and-css">
<h2><a class="toc-backref" href="#id32">Minifying Javascript</a><a class="headerlink" href="#minifying-javascript" title="Permalink to this headline"></a></h2> <h2><a class="toc-backref" href="#id33">Minifying Javascript and CSS</a><a class="headerlink" href="#minifying-javascript-and-css" title="Permalink to this headline"></a></h2>
<p>Please make sure to read the section <a class="reference internal" href="#development">Development</a> and that you have installed
all development dependencies (long story short, you can run <tt class="docutils literal"><span class="pre">npm</span> <span class="pre">install</span></tt>
and then <tt class="docutils literal"><span class="pre">grunt</span> <span class="pre">fetch</span></tt>).</p>
<p>We use <a class="reference external" href="http://requirejs.org">require.js</a> to keep track of <em>Converse.js</em> and its dependencies and to <p>We use <a class="reference external" href="http://requirejs.org">require.js</a> to keep track of <em>Converse.js</em> and its dependencies and to
to bundle them together in a single minified file fit for deployment to a to bundle them together in a single minified file fit for deployment to a
production site.</p> production site.</p>
<p>To use the require.js&#8217;s optimization tool, you&#8217;ll need Node and it&#8217;s package <p>To minify the Javascript and CSS, run the following command:</p>
manager, NPM.</p> <div class="highlight-python"><pre>grunt minify</pre>
<p>You can then install install require.js for Node like so:</p>
<div class="highlight-python"><pre>npm install requirejs</pre>
</div>
<p>The minified javascript file is then created like this:</p>
<div class="highlight-python"><pre>r.js -o build.js</pre>
</div>
<p>You should now have a new minified file (the name which is specified in build.js).</p>
<p>You can <a class="reference external" href="http://requirejs.org/docs/optimization.html">read more about require.js&#8217;s optimizer here</a>.</p>
</div>
<div class="section" id="minifying-css">
<h2><a class="toc-backref" href="#id33">Minifying CSS</a><a class="headerlink" href="#minifying-css" title="Permalink to this headline"></a></h2>
<p>CSS can be minimized with Yahoo&#8217;s yuicompressor tool:</p>
<div class="highlight-python"><pre>yui-compressor --type=css converse.css -o converse.min.css</pre>
</div> </div>
<p>Javascript will be bundled and minified via <a class="reference external" href="http://requirejs.org">require.js</a>&#8216;s optimization tool.
You can <a class="reference external" href="http://requirejs.org/docs/optimization.html">read more about require.js&#8217;s optimizer here</a>.</p>
<p>CSS is minified via <a class="reference external" href="https://github.com/gruntjs/grunt-contrib-cssmin">cssmin</a>.</p>
</div> </div>
</div> </div>
<div class="section" id="translations"> <div class="section" id="translations">

File diff suppressed because one or more lines are too long

View File

@ -542,40 +542,27 @@ be used.
Minification Minification
============ ============
Minifying Javascript Minifying Javascript and CSS
==================== ============================
Please make sure to read the section `Development`_ and that you have installed
all development dependencies (long story short, you can run ``npm install``
and then ``grunt fetch``).
We use `require.js`_ to keep track of *Converse.js* and its dependencies and to We use `require.js`_ to keep track of *Converse.js* and its dependencies and to
to bundle them together in a single minified file fit for deployment to a to bundle them together in a single minified file fit for deployment to a
production site. production site.
To use the require.js's optimization tool, you'll need Node and it's package To minify the Javascript and CSS, run the following command:
manager, NPM.
You can then install install require.js for Node like so:
:: ::
npm install requirejs grunt minify
The minified javascript file is then created like this:
::
r.js -o build.js
You should now have a new minified file (the name which is specified in build.js).
Javascript will be bundled and minified via `require.js`_'s optimization tool.
You can `read more about require.js's optimizer here`_. You can `read more about require.js's optimizer here`_.
Minifying CSS CSS is minified via `cssmin <https://github.com/gruntjs/grunt-contrib-cssmin>`_.
=============
CSS can be minimized with Yahoo's yuicompressor tool:
::
yui-compressor --type=css converse.css -o converse.min.css
============ ============

View File

@ -33,3 +33,10 @@ h1 a {
ul { ul {
margin-bottom: 5px; margin-bottom: 5px;
} }
tt.literal {
color: #222;
background-color: #fff;
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
font-size: 14px;
}