Skip to content

Commit

Permalink
[#1651] Simplify Node.js install instructions, fixes #1829
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Nov 6, 2015
1 parent 609dee4 commit 7518391
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
.. |nginx_config_file| replace:: /etc/nginx/sites-available/ckan
.. |reload_nginx| replace:: sudo service nginx reload
.. |jquery| replace:: jQuery
.. |nodejs| replace:: Node.js
.. _Jinja2: http://jinja.pocoo.org/
.. _CKAN front page: http://127.0.0.1:5000
Expand Down
49 changes: 24 additions & 25 deletions doc/contributing/frontend/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,45 +21,44 @@ Install frontend dependencies
-----------------------------

The front end stylesheets are written using
`LESS <http://lesscss.org/>`_ (this depends on
`Less <http://lesscss.org/>`_ (this depends on
`node.js <http://nodejs.org/>`_ being installed on the system)

Instructions for installing node can be found on the `node.js website
<http://nodejs.org/>`_. On Ubuntu 12.04 to 13.04, node.js (and npm node.js's
package manager) need to be installed via a `PPA
<https://launchpad.net/~chris-lea/+archive/node.js/>`_:
Instructions for installing |nodejs| can be found on the |nodejs| `website
<http://nodejs.org/>`_. Please check the ones relevant to your own distribution

::

$ sudo apt-add-repository ppa:chris-lea/node.js
$ sudo apt-get update
On Ubuntu, run the following to install |nodejs| official repository and the node
package::

Now run the command to install nodejs from the repository:
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs

::
.. note:: If you use the package on the default Ubuntu repositories (eg ``sudo apt-get install nodejs``),
the node binary will be called ``nodejs``. This will prevent the CKAN less script to
work properly, so you will need to create a link to make it work::

$ sudo apt-get install nodejs
ln -s /usr/bin/nodejs /usr/bin/node

On Ubuntu versions later than 13.04, npm can be installed directly from Ubuntu
packages
Also npm (the |nodejs| package manager) needs to be installed separately::

::
$ sudo apt-get install npm
sudo apt-get install npm

For more information, refer to the `Node wiki
<https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint-elementary-os>`_.
For more information, refer to the |nodejs| `website
<https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions>`_.

LESS can then be installed via the node package manager which is bundled
with node (or installed with apt as it is not bundled with node.js on
Ubuntu). We also use ``nodewatch`` to make our LESS compiler a watcher
Less can then be installed via the node package manager (npm).
We also use ``nodewatch`` to make our Less compiler a watcher
style script.

``cd`` into the ``pyenv/src/ckan`` and run:
``cd`` into the CKAN source folder (eg |virtualenv|/src/ckan ) and run:

::

$ npm install [email protected] nodewatch


You may need to use ``sudo`` depending on your CKAN install type.

--------------
File structure
--------------
Expand Down Expand Up @@ -103,7 +102,7 @@ separate words.

css
Should contain any site specific CSS files including compiled
production builds generated by LESS.
production builds generated by Less.
less
Should contain all the less files for the site. Additional vendor
styles should be added to the *vendor* directory and included in
Expand All @@ -128,7 +127,7 @@ test
Stylesheets
-----------

Because all the stylesheets are using LESS we need to compile them
Because all the stylesheets are using Less we need to compile them
before beginning development by running:

::
Expand All @@ -139,7 +138,7 @@ This will watch for changes to all of the less files and automatically
rebuild the CSS for you. To quit the script press ``ctrl-c``. There is also
``--production`` flag for compiling the production ``main.css``.

There are many LESS files which attempt to group the styles in useful
There are many Less files which attempt to group the styles in useful
groups. The main two are:

main.less:
Expand Down

0 comments on commit 7518391

Please sign in to comment.