Skip to content

Commit

Permalink
Update docs and improve dostrings for custom vars
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmiller committed Apr 8, 2012
1 parent 02a18be commit cd8641e
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 23 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,5 @@
.#*
*elc
*~
build
build
*.pyc
82 changes: 82 additions & 0 deletions doc/source/configuration.rst
@@ -0,0 +1,82 @@
.. _configuration:

=====================
Configuring Pony Mode
=====================

Pony Mode has a number of configuration values that you, the User can set to make your life more pleasant!

Global configuration
====================

There are a number of custom variables...

pony-etags-command
------------------
Command to generate tags table for project

Default: "find . | grep .py | xargs etags"

.. _pony-server-host:

pony-server-host
----------------
Host to run pony dev server

default: "localhost"

.. _pony-server-port:

pony-server-port
----------------
Port to run pony dev server

Default: 8000


pony-settings-module
--------------------
Settings module to use with manage.py

default: "settings"


pony-test-failfast
------------------

Run pony tests with failfast?
Defaultt

pony-sqlite-program
-------------------

Name of the executable to use when running a database REPL for Django
projects using sqlite.
Default: "sqlite3"

pony-snippet-dir
----------------

Directory in which to locate Yasnippet snippets for Pony Mode

Default: /path/to/pony-mode/snippets




Per - Project configuration
----------------------------

Pony projects are defined in the .dir-locals.el file at the root of your current project.

The file should look something like this::

;; Pony mode config for the megacorp project
((nil ;; This applies these settings regardless of major mode

(pony-settings . (make-pony-project
:python "/home/david/virtualenvs/megacorp/production/bin/python"
:settings "local_settings_file")
)))


30 changes: 15 additions & 15 deletions doc/source/details.rst
Expand Up @@ -5,6 +5,21 @@ Pony Mode Details

Pony Mode has at least more than twelve features for helping you work on your Django projects from Emacs

.. _dev-server:

Development server
------------------

The command::

M-x pony-runserver

(Which is bound by default to C-c C-p r) Will start the dev server for your current project

Pony Mode will check to see if runserver_plus is available, and will prefer to use that, falling back to the basic Django runserver.

You can configure the :ref:`pony-server-host` and :ref:`pony-server-port` your server runs on by configuring the custom variables.

Fabric Integration
------------------

Expand Down Expand Up @@ -62,18 +77,3 @@ If your setup is different to this, then the implicit Virtualenv detection may f

Fear not though! - you can customise the interpreter used by Pony-mode with a pony-project.

Projects
--------
Pony projects are defined in the .dir-locals.el file at the root of your current project.

The file should look something like this::

;; Pony mode config for the megacorp project
((nil ;; This applies these settings regardless of major mode

(pony-settings . (make-pony-project
:python "/home/david/virtualenvs/megacorp/production/bin/python"
:settings "local_settings_file")
)))


22 changes: 18 additions & 4 deletions doc/source/index.rst
Expand Up @@ -6,9 +6,7 @@ A Django mode for emacs.
Features (Non-exhaustive):
--------------------------

* Run dev server in an emacs buffer [C-c C-p r]
* Checks to see if runserver_plus is available
* If not uses in-built runserver
* Run the :ref:`dev-server` in an emacs buffer [C-c C-p r]
* Jump to current project in browser (start server if required) [C-c C-p b]
* Run test case at point in buffer [C-c C-p t]
* Run tests for current app in buffer [C-c C-p t]
Expand Down Expand Up @@ -40,7 +38,23 @@ How do I install Pony Mode?
Features
--------

:ref:`details`
Pony Mode has at least more than 3 features that make working on your Django projects from Emacs easier:

.. toctree::
:maxdepth: 2

details

Configuration
-------------

Configuration options for Pony Mode

.. toctree::
:maxdepth: 2

configuration


Bugs
----
Expand Down
4 changes: 2 additions & 2 deletions fabfile.py
Expand Up @@ -25,6 +25,6 @@ def upload_docs():
local("rm -rf pony-mode-docs.tar.gz")
local("tar zcvf pony-mode-docs.tar.gz *")
operations.put("pony-mode-docs.tar.gz",
"/home/happenup/webapps/pony-mode-docs/pony-mode-docs.tar.gz")
with cd("/home/happenup/webapps/pony-mode-docs/"):
"/home/happenup/webapps/ponydocs/pony-mode-docs.tar.gz")
with cd("/home/happenup/webapps/ponydocs/"):
run("tar zxvf pony-mode-docs.tar.gz")
2 changes: 1 addition & 1 deletion src/pony-mode.el
Expand Up @@ -53,7 +53,7 @@
:type 'string)

(defcustom pony-settings-module "settings"
"Settings file to use with manage.py"
"Settings module to use with manage.py"
:group 'pony
:type 'string)

Expand Down

0 comments on commit cd8641e

Please sign in to comment.