Skip to content

Commit e54cf3f

Browse files
committed
more doc cleanup
1 parent 4b91429 commit e54cf3f

File tree

4 files changed

+68
-41
lines changed

4 files changed

+68
-41
lines changed

README.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ Features
2323
4. Tab completion for commands that take a virtual environment as
2424
argument.
2525

26+
5. User-configurable hooks for all operations.
27+
28+
6. Plugin system for more creating sharable extensions.
29+
2630
Rich Leland has created a short `screencast
2731
<http://mathematism.com/2009/jul/30/presentation-pip-and-virtualenv/>`__
2832
showing off the features of virtualenvwrapper.
@@ -34,15 +38,15 @@ Quick Setup
3438
1. Create a directory to hold all of the virtual environments. The default is
3539
``$HOME/.virtualenvs``.
3640

37-
2. Add two lines to your shell startup script (``.bashrc``,
38-
``.bash_profile``, etc.) to set the location where the virtual
41+
2. Add two lines to your shell startup file (``.bashrc``,
42+
``.profile``, etc.) to set the location where the virtual
3943
environments should live and the location of the script installed
4044
with this package::
4145

4246
export WORKON_HOME=$HOME/.virtualenvs
4347
source /usr/local/bin/virtualenvwrapper.sh
4448

45-
3. Run: ``source ~/.bashrc``
49+
3. Reload the startup file (e.g., run: ``source ~/.bashrc``).
4650
4. Run: ``workon``
4751
5. A list of environments, empty, is printed.
4852
6. Run: ``mkvirtualenv temp``

docs/source/command_ref.rst

Lines changed: 52 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Syntax::
2424

2525
.. seealso::
2626

27-
* :ref:`hooks-scripts-premkvirtualenv`
28-
* :ref:`hooks-scripts-postmkvirtualenv`
27+
* :ref:`scripts-premkvirtualenv`
28+
* :ref:`scripts-postmkvirtualenv`
2929

3030
rmvirtualenv
3131
------------
@@ -38,8 +38,8 @@ Syntax::
3838

3939
.. seealso::
4040

41-
* :ref:`hooks-scripts-prermvirtualenv`
42-
* :ref:`hooks-scripts-postrmvirtualenv`
41+
* :ref:`scripts-prermvirtualenv`
42+
* :ref:`scripts-postrmvirtualenv`
4343

4444
cpvirtualenv
4545
------------
@@ -55,6 +55,10 @@ Syntax::
5555
The environment created by the copy operation is made `relocatable
5656
<http://virtualenv.openplans.org/#making-environments-relocatable>`__.
5757

58+
==================================
59+
Controlling the Active Environment
60+
==================================
61+
5862
workon
5963
------
6064

@@ -69,10 +73,10 @@ is printed to stdout.
6973

7074
.. seealso::
7175

72-
* :ref:`hooks-scripts-predeactivate`
73-
* :ref:`hooks-scripts-postdeactivate`
74-
* :ref:`hooks-scripts-preactivate`
75-
* :ref:`hooks-scripts-postactivate`
76+
* :ref:`scripts-predeactivate`
77+
* :ref:`scripts-postdeactivate`
78+
* :ref:`scripts-preactivate`
79+
* :ref:`scripts-postactivate`
7680

7781
deactivate
7882
----------
@@ -91,8 +95,8 @@ Syntax::
9195

9296
.. seealso::
9397

94-
* :ref:`hooks-scripts-predeactivate`
95-
* :ref:`hooks-scripts-postdeactivate`
98+
* :ref:`scripts-predeactivate`
99+
* :ref:`scripts-postdeactivate`
96100

97101
==================================
98102
Quickly Navigating to a virtualenv
@@ -104,6 +108,12 @@ currently-active virtualenv.
104108
cdvirtualenv
105109
------------
106110

111+
Change the current working directory to ``$VIRTUAL_ENV``.
112+
113+
Syntax::
114+
115+
cdvirtualenv [subdir]
116+
107117
Calling ``cdvirtualenv`` changes the current working directory to the
108118
top of the virtualenv (``$VIRTUAL_ENV``). An optional argument is
109119
appended to the path, allowing navigation directly into a
@@ -124,6 +134,13 @@ subdirectory.
124134
cdsitepackages
125135
--------------
126136

137+
Change the current working directory to the ``site-packages`` for
138+
``$VIRTUAL_ENV``.
139+
140+
Syntax::
141+
142+
cdsitepackages [subdir]
143+
127144
Because the exact path to the site-packages directory in the
128145
virtualenv depends on the version of Python, ``cdsitepackages`` is
129146
provided as a shortcut for ``cdvirtualenv
@@ -132,29 +149,28 @@ allowed, to specify a directory hierarchy within the ``site-packages``
132149
directory to change into.
133150

134151
::
152+
135153
$ workon pymotw
136154
$ echo $VIRTUAL_ENV
137155
/Users/dhellmann/.virtualenvs/pymotw
138156
$ cdsitepackages PyMOTW/bisect/
139157
$ pwd
140158
/Users/dhellmann/.virtualenvs/pymotw/lib/python2.6/site-packages/PyMOTW/bisect
141159

160+
lssitepackages
161+
--------------
162+
163+
Calling ``lssitepackages`` shows the content of the ``site-packages``
164+
directory of the currently-active virtualenv.
165+
166+
Syntax::
167+
168+
lssitepackages
169+
142170
===============
143171
Path Management
144172
===============
145173

146-
Sometimes it is desirable to share installed packages that are not in
147-
the system ``site-pacakges`` directory and which you do not want to
148-
install in each virtualenv. In this case, you *could* symlink the
149-
source into the environment ``site-packages`` directory, but it is
150-
also easy to add extra directories to the PYTHONPATH by including them
151-
in a .pth file inside ``site-packages`` using ``add2virtualenv``.
152-
153-
1. Check out the source for a big project, such as Django.
154-
2. Run: ``add2virtualenv path_to_source``.
155-
3. Run: ``add2virtualenv``.
156-
4. A usage message and list of current "extra" paths is printed.
157-
158174
add2virtualenv
159175
--------------
160176

@@ -165,17 +181,20 @@ Syntax::
165181

166182
add2virtualenv directory1 directory2 ...
167183

168-
Path management for packages outside of the virtual env. Based on a
169-
contribution from James Bennett and Jannis Leidel.
170-
171-
This will be done by placing the directory names in a path file named
172-
``virtualenv_path_extensions.pth`` inside the virtualenv's
173-
site-packages directory; if this file does not exist, it will be
174-
created first.
184+
Sometimes it is desirable to share installed packages that are not in
185+
the system ``site-pacakges`` directory and which should not be
186+
installed in each virtualenv. One possible solution is to symlink the
187+
source into the environment ``site-packages`` directory, but it is
188+
also easy to add extra directories to the PYTHONPATH by including them
189+
in a ``.pth`` file inside ``site-packages`` using ``add2virtualenv``.
175190

191+
1. Check out the source for a big project, such as Django.
192+
2. Run: ``add2virtualenv path_to_source``.
193+
3. Run: ``add2virtualenv``.
194+
4. A usage message and list of current "extra" paths is printed.
176195

177-
lssitepackages
178-
--------------
196+
The directory names are added to a path file named
197+
``virtualenv_path_extensions.pth`` inside the site-packages directory
198+
for the environment.
179199

180-
Calling ``lssitepackages`` shows the content of the ``site-packages``
181-
directory of the currently-active virtualenv.
200+
*Based on a contribution from James Bennett and Jannis Leidel.*

docs/source/index.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ Features
2424
3. Use a single command to switch between environments.
2525
4. Tab completion for commands that take a virtual environment as
2626
argument.
27-
5. User-configurable hooks for all operations.
27+
5. User-configurable hooks for all operations (see :ref:`scripts`).
28+
6. Plugin system for more creating sharable extensions (see
29+
:ref:`plugins`).
2830

2931
===========
3032
Quick Setup
@@ -33,13 +35,15 @@ Quick Setup
3335
1. Create a directory to hold all of the virtual environments. The default is
3436
``$HOME/.virtualenvs``.
3537

36-
2. Add two lines to your .bashrc to set the location where the virtual environments should
37-
live and the location of the script installed with this package::
38+
2. Add two lines to your shell startup file (``.bashrc``,
39+
``.profile``, etc.) to set the location where the virtual
40+
environments should live and the location of the script installed
41+
with this package::
3842

3943
export WORKON_HOME=$HOME/.virtualenvs
4044
source /usr/local/bin/virtualenvwrapper.sh
4145

42-
3. Run: ``source ~/.bashrc``
46+
3. Reload the startup file (e.g., run: ``source ~/.bashrc``).
4347
4. Run: ``workon``
4448
5. A list of environments, empty, is printed.
4549
6. Run: ``mkvirtualenv temp``

docs/source/plugins.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _developers-extensions:
1+
.. _plugins:
22

33
===================
44
Extension Plugins

0 commit comments

Comments
 (0)