Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
snippets
snippets_as
templates
README.md
requirements.txt
webserver.py

README.md

Template Development Server

This is a simple Snippet Server for development of Snippet Templates. It ignores the client configuration including locale, Firefox version and release channels and just returns all the snippets to the requesting client. If you only care for Snippet Template development this is the server for you.

Installation

  1. Make sure you're located in the simple_template_server directory, otherwise you'll be installing requirements for the full snippets service.

  2. Create and activate a Python virtualenv

    virtualenv venv
    . venv/bin/activate
  3. Install the needed packages

    pip install -r requirements.txt

Using the server

  1. Make sure you're in simple_template_server directory.

  2. Run the server

    python webserver.py

    The server listens on http://0.0.0.0:8000

    If you develop for Activity Stream set the SNIPPETS_STARTPAGE_VERSION environment variable to 5.

    SNIPPETS_STARTPAGE_VERSION=5 python webserver.py
  3. Add your templates in the snippets/ directory ending with .html. If you're developing for Activity Stream use the snippets_as/ directory instead.

  4. Most likely your template will have variables and you can add those in a YAML file under the same directory with the same base filename with .yml extension.

For demo purposes the snippets/ and snippets_as/ directories already contain snippet-one.html and the corresponding snippet-one.yml variable files.

You can add as many snippets you want and all of them will be served to every requesting browser. The server will auto-load the snippets on every request.

Detailed documentation on how to configure Firefox for development and on how to build snippet templates can be found in Snippet Documentation

You can’t perform that action at this time.