[pypy-svn] pypy documentation-cleanup: (lac, cfbolz): fix the auto-generation to generate links to the code on

cfbolz commits-noreply at bitbucket.org
Mon Apr 25 17:22:02 CEST 2011


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: documentation-cleanup
Changeset: r43602:07acca39c902
Date: 2011-04-25 17:21 +0200
http://bitbucket.org/pypy/pypy/changeset/07acca39c902/

Log:	(lac, cfbolz): fix the auto-generation to generate links to the code
	on bitbucket. use the auto-generation in more places. also, check
	that _ref.rst is included where it needs to be.

diff --git a/pypy/doc/getting-started-dev.rst b/pypy/doc/getting-started-dev.rst
--- a/pypy/doc/getting-started-dev.rst
+++ b/pypy/doc/getting-started-dev.rst
@@ -152,11 +152,11 @@
 or start off at one of the following points:
 
 *  `pypy/interpreter`_ contains the bytecode interpreter: bytecode dispatcher
-   in pyopcode.py_, frame and code objects in eval.py_ and pyframe.py_,
-   function objects and argument passing in function.py_ and argument.py_,
-   the object space interface definition in baseobjspace.py_, modules in
-   module.py_ and mixedmodule.py_.  Core types supporting the bytecode 
-   interpreter are defined in typedef.py_.
+   in `pypy/interpreter/pyopcode.py`_, frame and code objects in `pypy/interpreter/eval.py`_ and `pypy/interpreter/pyframe.py`_,
+   function objects and argument passing in `pypy/interpreter/function.py`_ and `pypy/interpreter/argument.py`_,
+   the object space interface definition in `pypy/interpreter/baseobjspace.py`_, modules in
+   `pypy/interpreter/module.py`_ and `pypy/interpreter/mixedmodule.py`_.  Core types supporting the bytecode 
+   interpreter are defined in `pypy/interpreter/typedef.py`_.
 
 *  `pypy/interpreter/pyparser`_ contains a recursive descent parser,
    and input data files that allow it to parse both Python 2.3 and 2.4
@@ -170,17 +170,17 @@
    resulting binary interactively much more pleasant.
 
 *  `pypy/objspace/std`_ contains the `Standard object space`_.  The main file
-   is objspace.py_.  For each type, the files ``xxxtype.py`` and
+   is `pypy/interpreter/objspace.py`_.  For each type, the files ``xxxtype.py`` and
    ``xxxobject.py`` contain respectively the definition of the type and its
    (default) implementation.
 
-*  `pypy/objspace`_ contains a few other object spaces: the thunk_,
-   trace_ and flow_ object spaces.  The latter is a relatively short piece
+*  `pypy/objspace`_ contains a few other object spaces: the `pypy/objspace/thunk.py`_,
+   `pypy/objspace/trace`_ and `pypy/objspace/flow`_ object spaces.  The latter is a relatively short piece
    of code that builds the control flow graphs when the bytecode interpreter
    runs in it.
 
 *  `pypy/translator`_ contains the code analysis and generation stuff.
-   Start reading from translator.py_, from which it should be easy to follow
+   Start reading from translator.py, from which it should be easy to follow
    the pieces of code involved in the various translation phases.
 
 *  `pypy/annotation`_ contains the data model for the type annotation that
@@ -397,21 +397,7 @@
 
 .. _`Dot Graphviz`:           http://www.graphviz.org/
 .. _Pygame:                 http://www.pygame.org/
-.. _pyopcode.py:            https://bitbucket.org/pypy/pypy/src/tip/pypy/interpreter/pyopcode.py
-.. _eval.py:                https://bitbucket.org/pypy/pypy/src/tip/pypy/interpreter/eval.py
-.. _pyframe.py:             https://bitbucket.org/pypy/pypy/src/tip/pypy/interpreter/pyframe.py
-.. _function.py:            https://bitbucket.org/pypy/pypy/src/tip/pypy/interpreter/function.py
-.. _argument.py:            https://bitbucket.org/pypy/pypy/src/tip/pypy/interpreter/argument.py
-.. _baseobjspace.py:        https://bitbucket.org/pypy/pypy/src/tip/pypy/interpreter/baseobjspace.py
-.. _module.py:              https://bitbucket.org/pypy/pypy/src/tip/pypy/interpreter/module.py
-.. _mixedmodule.py:          https://bitbucket.org/pypy/pypy/src/tip/pypy/interpreter/mixedmodule.py
-.. _typedef.py:             https://bitbucket.org/pypy/pypy/src/tip/pypy/interpreter/typedef.py
 .. _Standard object space:  objspace.html#the-standard-object-space
-.. _objspace.py:            ../../../../pypy/objspace/std/objspace.py
-.. _thunk:                  ../../../../pypy/objspace/thunk.py
-.. _trace:                  ../../../../pypy/objspace/trace.py
-.. _flow:                   ../../../../pypy/objspace/flow/
-.. _translator.py:          ../../../../pypy/translator/translator.py
 .. _mailing lists:          index.html
 .. _documentation:          docindex.html 
 .. _unit tests:             coding-guide.html#test-design

diff --git a/pypy/doc/objspace-proxies.rst b/pypy/doc/objspace-proxies.rst
--- a/pypy/doc/objspace-proxies.rst
+++ b/pypy/doc/objspace-proxies.rst
@@ -485,7 +485,7 @@
 ----------------------------------------------------
 
 Suppose we want to have a list which stores all operations performed on
-it for later analysis.  We can use the small `tputil`_ module to help
+it for later analysis.  We can use the small `lib_pypy/tputil.py`_ module to help
 with transparently proxying builtin instances::
 
    from tputil import make_proxy
@@ -534,10 +534,10 @@
 
 .. _tputil: 
 
-tputil help module 
+tputil helper module 
 ----------------------------
 
-The `tputil.py`_ module provides: 
+The `lib_pypy/tputil.py`_ module provides: 
 
 * ``make_proxy(controller, type, obj)``: function which 
   creates a transparent proxy controlled by the given 
@@ -595,8 +595,8 @@
 to application level code. 
 
 Transparent proxies are implemented on top of the `standard object
-space`_, in `proxy_helpers.py`_, `proxyobject.py`_ and
-`transparent.py`_.  To use them you will need to pass a
+space`_, in `pypy/objspace/std/proxy_helpers.py`_, `pypy/objspace/std/proxyobject.py`_ and
+`pypy/objspace/std/transparent.py`_.  To use them you will need to pass a
 `--objspace-std-withtproxy`_ option to ``py.py`` or
 ``translate.py``.  This registers implementations named
 ``W_TransparentXxx`` - which usually correspond to an
@@ -607,10 +607,6 @@
 lists, dicts, exceptions, tracebacks and frames.
 
 .. _`standard object space`: objspace.html#the-standard-object-space
-.. _`proxy_helpers.py`: ../../../../pypy/objspace/std/proxy_helpers.py
-.. _`proxyobject.py`: ../../../../pypy/objspace/std/proxyobject.py
-.. _`transparent.py`: ../../../../pypy/objspace/std/transparent.py
-.. _`tputil.py`: ../../lib_pypy/tputil.py
 
 .. [D12.1] `High-Level Backends and Interpreter Feature Prototypes`, PyPy
            EU-Report, 2007, http://codespeak.net/pypy/extradoc/eu-report/D12.1_H-L-Backends_and_Feature_Prototypes-2007-03-22.pdf

diff --git a/pypy/doc/garbage_collection.rst b/pypy/doc/garbage_collection.rst
--- a/pypy/doc/garbage_collection.rst
+++ b/pypy/doc/garbage_collection.rst
@@ -19,6 +19,8 @@
 Garbage collectors currently written for the GC framework
 =========================================================
 
+XXX we need to add something about minimark
+
 (Very rough sketch only for now.)
 
 Reminder: to select which GC you want to include in a translated
@@ -32,7 +34,7 @@
 --------------
 
 Classical Mark and Sweep collector.  Also contains a lot of experimental
-and half-unmaintained features.  See `rpython/memory/gc/marksweep.py`_.
+and half-unmaintained features.  See `pypy/rpython/memory/gc/marksweep.py`_.
 
 Semispace copying collector
 ---------------------------
@@ -40,7 +42,7 @@
 Two arenas of equal size, with only one arena in use and getting filled
 with new objects.  When the arena is full, the live objects are copied
 into the other arena using Cheney's algorithm.  The old arena is then
-cleared.  See `rpython/memory/gc/semispace.py`_.
+cleared.  See `pypy/rpython/memory/gc/semispace.py`_.
 
 On Unix the clearing is done by reading ``/dev/zero`` into the arena,
 which is extremely memory efficient at least on Linux: it lets the
@@ -53,7 +55,7 @@
 Generational GC
 ---------------
 
-This is a two-generations GC.  See `rpython/memory/gc/generation.py`_.
+This is a two-generations GC.  See `pypy/rpython/memory/gc/generation.py`_.
 
 It is implemented as a subclass of the Semispace copying collector.  It
 adds a nursery, which is a chunk of the current semispace.  Its size is
@@ -84,7 +86,7 @@
 Each generation is collected much less often than the previous one.  The
 division of the generations is slightly more complicated than just
 nursery / semispace / external; see the diagram at the start of the
-source code, in `rpython/memory/gc/hybrid.py`_.
+source code, in `pypy/rpython/memory/gc/hybrid.py`_.
 
 Mark & Compact GC
 -----------------
@@ -122,6 +124,6 @@
 information in the regular headers.
 
 More details are available as comments at the start of the source
-in `rpython/memory/gc/markcompact.py`_.
+in `pypy/rpython/memory/gc/markcompact.py`_.
 
 .. include:: _ref.rst

diff --git a/pypy/doc/interpreter.rst b/pypy/doc/interpreter.rst
--- a/pypy/doc/interpreter.rst
+++ b/pypy/doc/interpreter.rst
@@ -14,7 +14,7 @@
 
 PyPy's bytecode interpreter has a structure reminiscent of CPython's
 Virtual Machine: It processes code objects parsed and compiled from
-Python source code.  It is implemented in the `interpreter/`_ directory.
+Python source code.  It is implemented in the `pypy/interpreter/`_ directory.
 People familiar with the CPython implementation will easily recognize
 similar concepts there.  The major differences are the overall usage of
 the `object space`_ indirection to perform operations on objects, and
@@ -27,7 +27,7 @@
 abstract syntax tree builder, bytecode generator).  The latter passes
 are based on the ``compiler`` package from the standard library of
 CPython, with various improvements and bug fixes. The bytecode compiler
-(living under `interpreter/astcompiler/`_) is now integrated and is
+(living under `pypy/interpreter/astcompiler/`_) is now integrated and is
 translated with the rest of PyPy.
 
 Code objects contain

diff --git a/pypy/doc/translation.rst b/pypy/doc/translation.rst
--- a/pypy/doc/translation.rst
+++ b/pypy/doc/translation.rst
@@ -90,7 +90,7 @@
 (although these steps are not quite as distinct as you might think from
 this presentation).
 
-There is an `interactive interface`_ called `translatorshell.py`_ to the
+There is an `interactive interface`_ called `pypy/bin/translatorshell.py`_ to the
 translation process which allows you to interactively work through these
 stages.
 
@@ -104,7 +104,6 @@
 .. _`abstract interpretation`: http://en.wikipedia.org/wiki/Abstract_interpretation
 .. _`Flow Object Space`: objspace.html#the-flow-object-space
 .. _`interactive interface`: getting-started-dev.html#try-out-the-translator
-.. _`translatorshell.py`: ../../../../pypy/bin/translatorshell.py
 
 .. _`flow model`:
 .. _`control flow graphs`: 
@@ -117,7 +116,7 @@
 which are the basic data structures of the translation
 process.
 
-All these types are defined in `pypy.objspace.flow.model`_ (which is a rather
+All these types are defined in `pypy/objspace/flow/model/`_ (which is a rather
 important module in the PyPy source base, to reinforce the point).
 
 The flow graph of a function is represented by the class ``FunctionGraph``.
@@ -271,7 +270,6 @@
     should not attempt to actually mutate such Constants.
 
 .. _`document describing object spaces`: objspace.html
-.. _`pypy.objspace.flow.model`: ../../../../pypy/objspace/flow/model.py
 
 
 .. _Annotator:
@@ -295,7 +293,7 @@
 An "annotation" is an instance of a subclass of ``SomeObject``.  Each
 subclass that represents a specific family of objects.
 
-Here is an overview (see ``pypy.annotation.model``):
+Here is an overview (see ``pypy/annotation/model/``):
 
 * ``SomeObject`` is the base class.  An instance of ``SomeObject()``
   represents any Python object, and as such usually means that the input

diff --git a/pypy/doc/getting-started-python.rst b/pypy/doc/getting-started-python.rst
--- a/pypy/doc/getting-started-python.rst
+++ b/pypy/doc/getting-started-python.rst
@@ -147,14 +147,6 @@
 
     ./translate.py --backend=cli targetpypystandalone.py
 
-Or better, try out the experimental `branch/cli-jit`_ described by
-Antonio Cuni's `Ph.D. thesis`_ and translate with the JIT::
-
-    ./translate.py -Ojit --backend=cli targetpypystandalone.py
-
-.. _`branch/cli-jit`: https://bitbucket.org/pypy/pypy/src/tip
-.. _`Ph.D. thesis`: http://codespeak.net/svn/user/antocuni/phd/thesis/thesis.pdf
-
 The executable and all its dependencies will be stored in the
 ./pypy-cli-data directory. To run pypy.NET, you can run
 ./pypy-cli-data/main.exe. If you are using Linux or Mac, you can use

diff --git a/pypy/doc/_ref.rst b/pypy/doc/_ref.rst
--- a/pypy/doc/_ref.rst
+++ b/pypy/doc/_ref.rst
@@ -1,106 +1,126 @@
-.. _`demo/`: ../../demo
-.. _`demo/pickle_coroutine.py`: ../../demo/pickle_coroutine.py
-.. _`lib-python/`: ../../lib-python
-.. _`lib-python/2.5.2/dis.py`: ../../lib-python/2.5.2/dis.py
-.. _`annotation/`:
-.. _`pypy/annotation`: ../../../../pypy/annotation
-.. _`pypy/annotation/annrpython.py`: ../../../../pypy/annotation/annrpython.py
-.. _`annotation/binaryop.py`: ../../../../pypy/annotation/binaryop.py
-.. _`pypy/annotation/builtin.py`: ../../../../pypy/annotation/builtin.py
-.. _`pypy/annotation/model.py`: ../../../../pypy/annotation/model.py
-.. _`bin/`: ../../../../pypy/bin
-.. _`config/`: ../../../../pypy/config
-.. _`pypy/config/pypyoption.py`: ../../../../pypy/config/pypyoption.py
-.. _`doc/`: ../../../../pypy/doc
-.. _`doc/config/`: ../../../../pypy/doc/config
-.. _`doc/discussion/`: ../../../../pypy/doc/discussion
-.. _`interpreter/`:
-.. _`pypy/interpreter`: ../../../../pypy/interpreter
-.. _`pypy/interpreter/argument.py`: ../../../../pypy/interpreter/argument.py
-.. _`interpreter/astcompiler/`:
-.. _`pypy/interpreter/astcompiler`: ../../../../pypy/interpreter/astcompiler
-.. _`pypy/interpreter/executioncontext.py`: ../../../../pypy/interpreter/executioncontext.py
-.. _`pypy/interpreter/function.py`: ../../../../pypy/interpreter/function.py
-.. _`interpreter/gateway.py`:
-.. _`pypy/interpreter/gateway.py`: ../../../../pypy/interpreter/gateway.py
-.. _`pypy/interpreter/generator.py`: ../../../../pypy/interpreter/generator.py
-.. _`pypy/interpreter/mixedmodule.py`: ../../../../pypy/interpreter/mixedmodule.py
-.. _`pypy/interpreter/module.py`: ../../../../pypy/interpreter/module.py
-.. _`pypy/interpreter/nestedscope.py`: ../../../../pypy/interpreter/nestedscope.py
-.. _`pypy/interpreter/pyopcode.py`: ../../../../pypy/interpreter/pyopcode.py
-.. _`interpreter/pyparser/`:
-.. _`pypy/interpreter/pyparser`: ../../../../pypy/interpreter/pyparser
-.. _`pypy/interpreter/pyparser/pytokenizer.py`: ../../../../pypy/interpreter/pyparser/pytokenizer.py
-.. _`pypy/interpreter/pyparser/parser.py`: ../../../../pypy/interpreter/pyparser/parser.py
-.. _`pypy/interpreter/pyparser/pyparse.py`: ../../../../pypy/interpreter/pyparser/pyparse.py
-.. _`pypy/interpreter/pyparser/future.py`: ../../../../pypy/interpreter/pyparser/future.py
-.. _`pypy/interpreter/pyparser/metaparser.py`: ../../../../pypy/interpreter/pyparser/metaparser.py
-.. _`pypy/interpreter/astcompiler/astbuilder.py`: ../../../../pypy/interpreter/astcompiler/astbuilder.py
-.. _`pypy/interpreter/astcompiler/optimize.py`: ../../../../pypy/interpreter/astcompiler/optimize.py
-.. _`pypy/interpreter/astcompiler/codegen.py`: ../../../../pypy/interpreter/astcompiler/codegen.py
-.. _`pypy/interpreter/astcompiler/tools/asdl_py.py`: ../../../../pypy/interpreter/astcompiler/tools/asdl_py.py
-.. _`pypy/interpreter/astcompiler/tools/Python.asdl`: ../../../../pypy/interpreter/astcompiler/tools/Python.asdl
-.. _`pypy/interpreter/astcompiler/assemble.py`: ../../../../pypy/interpreter/astcompiler/assemble.py
-.. _`pypy/interpreter/astcompiler/symtable.py`: ../../../../pypy/interpreter/astcompiler/symtable.py
-.. _`pypy/interpreter/astcompiler/asthelpers.py`: ../../../../pypy/interpreter/astcompiler/asthelpers.py
-.. _`pypy/interpreter/astcompiler/ast.py`: ../../../../pypy/interpreter/astcompiler/ast.py
-.. _`pypy/interpreter/typedef.py`: ../../../../pypy/interpreter/typedef.py
-.. _`lib/`:
-.. _`lib_pypy/`: ../../lib_pypy
-.. _`lib/distributed/`: ../../lib_pypy/distributed
-.. _`lib_pypy/stackless.py`: ../../lib_pypy/stackless.py
-.. _`lib_pypy/pypy_test/`: ../../lib_pypy/pypy_test
-.. _`module/`:
-.. _`pypy/module`:
-.. _`pypy/module/`: ../../../../pypy/module
-.. _`pypy/module/__builtin__/__init__.py`: ../../../../pypy/module/__builtin__/__init__.py
-.. _`pypy/module/_stackless/test/test_clonable.py`: ../../../../pypy/module/_stackless/test/test_clonable.py
-.. _`pypy/module/_stackless/test/test_composable_coroutine.py`: ../../../../pypy/module/_stackless/test/test_composable_coroutine.py
-.. _`objspace/`:
-.. _`pypy/objspace`: ../../../../pypy/objspace
-.. _`objspace/dump.py`: ../../../../pypy/objspace/dump.py
-.. _`objspace/flow/`: ../../../../pypy/objspace/flow
-.. _`objspace/std/`:
-.. _`pypy/objspace/std`: ../../../../pypy/objspace/std
-.. _`objspace/taint.py`: ../../../../pypy/objspace/taint.py
-.. _`objspace/thunk.py`:
-.. _`pypy/objspace/thunk.py`: ../../../../pypy/objspace/thunk.py
-.. _`objspace/trace.py`:
-.. _`pypy/objspace/trace.py`: ../../../../pypy/objspace/trace.py
-.. _`pypy/rlib`:
-.. _`rlib/`: ../../../../pypy/rlib
-.. _`pypy/rlib/rarithmetic.py`: ../../../../pypy/rlib/rarithmetic.py
-.. _`pypy/rlib/test`: ../../../../pypy/rlib/test
-.. _`pypy/rpython`:
-.. _`pypy/rpython/`:
-.. _`rpython/`: ../../../../pypy/rpython
-.. _`rpython/lltypesystem/`: ../../../../pypy/rpython/lltypesystem
-.. _`pypy/rpython/lltypesystem/lltype.py`:
-.. _`rpython/lltypesystem/lltype.py`: ../../../../pypy/rpython/lltypesystem/lltype.py
-.. _`rpython/memory/`: ../../../../pypy/rpython/memory
-.. _`rpython/memory/gc/generation.py`: ../../../../pypy/rpython/memory/gc/generation.py
-.. _`rpython/memory/gc/hybrid.py`: ../../../../pypy/rpython/memory/gc/hybrid.py
-.. _`rpython/memory/gc/markcompact.py`: ../../../../pypy/rpython/memory/gc/markcompact.py
-.. _`rpython/memory/gc/marksweep.py`: ../../../../pypy/rpython/memory/gc/marksweep.py
-.. _`rpython/memory/gc/semispace.py`: ../../../../pypy/rpython/memory/gc/semispace.py
-.. _`rpython/ootypesystem/`: ../../../../pypy/rpython/ootypesystem
-.. _`rpython/ootypesystem/ootype.py`: ../../../../pypy/rpython/ootypesystem/ootype.py
-.. _`rpython/rint.py`: ../../../../pypy/rpython/rint.py
-.. _`rpython/rlist.py`: ../../../../pypy/rpython/rlist.py
-.. _`rpython/rmodel.py`: ../../../../pypy/rpython/rmodel.py
-.. _`pypy/rpython/rtyper.py`: ../../../../pypy/rpython/rtyper.py
-.. _`pypy/rpython/test/test_llinterp.py`: ../../../../pypy/rpython/test/test_llinterp.py
-.. _`pypy/test_all.py`: ../../../../pypy/test_all.py
-.. _`tool/`: ../../../../pypy/tool
-.. _`tool/algo/`: ../../../../pypy/tool/algo
-.. _`tool/pytest/`: ../../../../pypy/tool/pytest
-.. _`pypy/translator`:
-.. _`translator/`: ../../../../pypy/translator
-.. _`translator/backendopt/`: ../../../../pypy/translator/backendopt
-.. _`translator/c/`: ../../../../pypy/translator/c
-.. _`translator/cli/`: ../../../../pypy/translator/cli
-.. _`translator/goal/`: ../../../../pypy/translator/goal
-.. _`pypy/translator/goal/targetnopstandalone.py`: ../../../../pypy/translator/goal/targetnopstandalone.py
-.. _`translator/jvm/`: ../../../../pypy/translator/jvm
-.. _`translator/stackless/`: ../../../../pypy/translator/stackless
-.. _`translator/tool/`: ../../../../pypy/translator/tool
+.. _`./LICENSE`: https://bitbucket.org/pypy/pypy/src/default/./LICENSE
+.. _`demo/`: https://bitbucket.org/pypy/pypy/src/default/demo/
+.. _`demo/pickle_coroutine.py`: https://bitbucket.org/pypy/pypy/src/default/demo/pickle_coroutine.py
+.. _`lib-python/`: https://bitbucket.org/pypy/pypy/src/default/lib-python/
+.. _`lib-python/2.5.2/dis.py`: https://bitbucket.org/pypy/pypy/src/default/lib-python/2.5.2/dis.py
+.. _`lib_pypy/`: https://bitbucket.org/pypy/pypy/src/default/lib_pypy/
+.. _`lib_pypy/pypy_test/`: https://bitbucket.org/pypy/pypy/src/default/lib_pypy/pypy_test/
+.. _`lib_pypy/stackless.py`: https://bitbucket.org/pypy/pypy/src/default/lib_pypy/stackless.py
+.. _`lib_pypy/tputil.py`: https://bitbucket.org/pypy/pypy/src/default/lib_pypy/tputil.py
+.. _`pypy/annotation`: https://bitbucket.org/pypy/pypy/src/default/pypy/annotation
+.. _`pypy/annotation/`: https://bitbucket.org/pypy/pypy/src/default/pypy/annotation/
+.. _`pypy/annotation/annrpython.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/annotation/annrpython.py
+.. _`pypy/annotation/binaryop.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/annotation/binaryop.py
+.. _`pypy/annotation/builtin.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/annotation/builtin.py
+.. _`pypy/bin/`: https://bitbucket.org/pypy/pypy/src/default/pypy/bin/
+.. _`pypy/bin/translatorshell.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/bin/translatorshell.py
+.. _`pypy/config/`: https://bitbucket.org/pypy/pypy/src/default/pypy/config/
+.. _`pypy/config/pypyoption.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/config/pypyoption.py
+.. _`pypy/config/translationoption.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/config/translationoption.py
+.. _`pypy/doc/`: https://bitbucket.org/pypy/pypy/src/default/pypy/doc/
+.. _`pypy/doc/config/`: https://bitbucket.org/pypy/pypy/src/default/pypy/doc/config/
+.. _`pypy/doc/discussion/`: https://bitbucket.org/pypy/pypy/src/default/pypy/doc/discussion/
+.. _`pypy/interpreter`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter
+.. _`pypy/interpreter/`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/
+.. _`pypy/interpreter/argument.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/argument.py
+.. _`pypy/interpreter/astcompiler`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/astcompiler
+.. _`pypy/interpreter/astcompiler/`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/astcompiler/
+.. _`pypy/interpreter/astcompiler/assemble.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/astcompiler/assemble.py
+.. _`pypy/interpreter/astcompiler/ast.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/astcompiler/ast.py
+.. _`pypy/interpreter/astcompiler/astbuilder.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/astcompiler/astbuilder.py
+.. _`pypy/interpreter/astcompiler/asthelpers.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/astcompiler/asthelpers.py
+.. _`pypy/interpreter/astcompiler/codegen.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/astcompiler/codegen.py
+.. _`pypy/interpreter/astcompiler/optimize.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/astcompiler/optimize.py
+.. _`pypy/interpreter/astcompiler/symtable.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/astcompiler/symtable.py
+.. _`pypy/interpreter/astcompiler/tools/Python.asdl`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/astcompiler/tools/Python.asdl
+.. _`pypy/interpreter/astcompiler/tools/asdl_py.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/astcompiler/tools/asdl_py.py
+.. _`pypy/interpreter/baseobjspace.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/baseobjspace.py
+.. _`pypy/interpreter/eval.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/eval.py
+.. _`pypy/interpreter/executioncontext.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/executioncontext.py
+.. _`pypy/interpreter/function.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/function.py
+.. _`pypy/interpreter/gateway.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/gateway.py
+.. _`pypy/interpreter/generator.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/generator.py
+.. _`pypy/interpreter/mixedmodule.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/mixedmodule.py
+.. _`pypy/interpreter/module.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/module.py
+.. _`pypy/interpreter/nestedscope.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/nestedscope.py
+.. _`pypy/interpreter/objspace.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/objspace.py
+.. _`pypy/interpreter/pyframe.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/pyframe.py
+.. _`pypy/interpreter/pyopcode.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/pyopcode.py
+.. _`pypy/interpreter/pyparser`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/pyparser
+.. _`pypy/interpreter/pyparser/`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/pyparser/
+.. _`pypy/interpreter/pyparser/future.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/pyparser/future.py
+.. _`pypy/interpreter/pyparser/metaparser.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/pyparser/metaparser.py
+.. _`pypy/interpreter/pyparser/parser.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/pyparser/parser.py
+.. _`pypy/interpreter/pyparser/pyparse.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/pyparser/pyparse.py
+.. _`pypy/interpreter/pyparser/pytokenizer.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/pyparser/pytokenizer.py
+.. _`pypy/interpreter/typedef.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/interpreter/typedef.py
+.. _`pypy/module`: https://bitbucket.org/pypy/pypy/src/default/pypy/module
+.. _`pypy/module/`: https://bitbucket.org/pypy/pypy/src/default/pypy/module/
+.. _`pypy/module/__builtin__/__init__.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/module/__builtin__/__init__.py
+.. _`pypy/module/_stackless/test/test_composable_coroutine.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/module/_stackless/test/test_composable_coroutine.py
+.. _`pypy/objspace`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace
+.. _`pypy/objspace/`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/
+.. _`pypy/objspace/dump.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/dump.py
+.. _`pypy/objspace/flow`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/flow
+.. _`pypy/objspace/flow/`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/flow/
+.. _`pypy/objspace/flow/model/`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/flow/model/
+.. _`pypy/objspace/std`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std
+.. _`pypy/objspace/std/`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/
+.. _`pypy/objspace/std/listtype.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/listtype.py
+.. _`pypy/objspace/std/multimethod.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/multimethod.py
+.. _`pypy/objspace/std/proxy_helpers.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/proxy_helpers.py
+.. _`pypy/objspace/std/proxyobject.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/proxyobject.py
+.. _`pypy/objspace/std/stringtype.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/stringtype.py
+.. _`pypy/objspace/std/transparent.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/transparent.py
+.. _`pypy/objspace/std/tupleobject.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/tupleobject.py
+.. _`pypy/objspace/std/tupletype.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/std/tupletype.py
+.. _`pypy/objspace/taint.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/taint.py
+.. _`pypy/objspace/thunk.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/thunk.py
+.. _`pypy/objspace/trace`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/trace
+.. _`pypy/objspace/trace.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/objspace/trace.py
+.. _`pypy/rlib`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib
+.. _`pypy/rlib/`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/
+.. _`pypy/rlib/listsort.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/listsort.py
+.. _`pypy/rlib/nonconst.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/nonconst.py
+.. _`pypy/rlib/objectmodel.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/objectmodel.py
+.. _`pypy/rlib/parsing/`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/parsing/
+.. _`pypy/rlib/parsing/tree.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/parsing/tree.py
+.. _`pypy/rlib/rarithmetic.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/rarithmetic.py
+.. _`pypy/rlib/rbigint.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/rbigint.py
+.. _`pypy/rlib/rrandom.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/rrandom.py
+.. _`pypy/rlib/rsocket.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/rsocket.py
+.. _`pypy/rlib/rstack.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/rstack.py
+.. _`pypy/rlib/streamio.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/streamio.py
+.. _`pypy/rlib/test`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/test
+.. _`pypy/rlib/unroll.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rlib/unroll.py
+.. _`pypy/rpython`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython
+.. _`pypy/rpython/`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/
+.. _`pypy/rpython/lltypesystem/`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/lltypesystem/
+.. _`pypy/rpython/lltypesystem/lltype.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/lltypesystem/lltype.py
+.. _`pypy/rpython/memory/`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/memory/
+.. _`pypy/rpython/memory/gc/generation.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/memory/gc/generation.py
+.. _`pypy/rpython/memory/gc/hybrid.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/memory/gc/hybrid.py
+.. _`pypy/rpython/memory/gc/markcompact.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/memory/gc/markcompact.py
+.. _`pypy/rpython/memory/gc/marksweep.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/memory/gc/marksweep.py
+.. _`pypy/rpython/memory/gc/semispace.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/memory/gc/semispace.py
+.. _`pypy/rpython/ootypesystem/`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/ootypesystem/
+.. _`pypy/rpython/ootypesystem/ootype.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/ootypesystem/ootype.py
+.. _`pypy/rpython/rint.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/rint.py
+.. _`pypy/rpython/rlist.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/rlist.py
+.. _`pypy/rpython/rmodel.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/rmodel.py
+.. _`pypy/rpython/rtyper.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/rtyper.py
+.. _`pypy/rpython/test/test_llinterp.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/rpython/test/test_llinterp.py
+.. _`pypy/tool/`: https://bitbucket.org/pypy/pypy/src/default/pypy/tool/
+.. _`pypy/tool/algo/`: https://bitbucket.org/pypy/pypy/src/default/pypy/tool/algo/
+.. _`pypy/tool/pytest/`: https://bitbucket.org/pypy/pypy/src/default/pypy/tool/pytest/
+.. _`pypy/tool/traceconfig.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/tool/traceconfig.py
+.. _`pypy/translator`: https://bitbucket.org/pypy/pypy/src/default/pypy/translator
+.. _`pypy/translator/`: https://bitbucket.org/pypy/pypy/src/default/pypy/translator/
+.. _`pypy/translator/backendopt/`: https://bitbucket.org/pypy/pypy/src/default/pypy/translator/backendopt/
+.. _`pypy/translator/c/`: https://bitbucket.org/pypy/pypy/src/default/pypy/translator/c/
+.. _`pypy/translator/cli/`: https://bitbucket.org/pypy/pypy/src/default/pypy/translator/cli/
+.. _`pypy/translator/goal/`: https://bitbucket.org/pypy/pypy/src/default/pypy/translator/goal/
+.. _`pypy/translator/goal/targetnopstandalone.py`: https://bitbucket.org/pypy/pypy/src/default/pypy/translator/goal/targetnopstandalone.py
+.. _`pypy/translator/jvm/`: https://bitbucket.org/pypy/pypy/src/default/pypy/translator/jvm/
+.. _`pypy/translator/stackless/`: https://bitbucket.org/pypy/pypy/src/default/pypy/translator/stackless/
+.. _`pypy/translator/tool/`: https://bitbucket.org/pypy/pypy/src/default/pypy/translator/tool/

diff --git a/pypy/doc/docindex.rst b/pypy/doc/docindex.rst
--- a/pypy/doc/docindex.rst
+++ b/pypy/doc/docindex.rst
@@ -57,7 +57,7 @@
 
 `development methodology`_ describes our sprint-driven approach.
 
-`license`_ contains licensing details (basically a straight MIT-license). 
+`./LICENSE`_ contains licensing details (basically a straight MIT-license). 
 
 `Glossary`_ of PyPy words to help you align your inner self with
 the PyPy universe.
@@ -149,7 +149,6 @@
 .. _`development methodology`: dev_method.html
 .. _`sprint reports`: sprint-reports.html
 .. _`papers, talks and related projects`: extradoc.html
-.. _`license`: ../../LICENSE
 .. _`PyPy LOC statistics`: http://codespeak.net/~hpk/pypy-stat/
 .. _`PyPy statistics`: http://codespeak.net/pypy/trunk/pypy/doc/statistic
 .. _`object spaces`: objspace.html 
@@ -178,92 +177,92 @@
 Here is a fully referenced alphabetical two-level deep 
 directory overview of PyPy: 
 
-============================   =========================================== 
-Directory                      explanation/links
-============================   =========================================== 
-`annotation/`_                 `type inferencing code`_ for `RPython`_ programs 
+================================   =========================================== 
+Directory                          explanation/links
+================================   =========================================== 
+`pypy/annotation/`_                `type inferencing code`_ for `RPython`_ programs 
 
-`bin/`_                        command-line scripts, mainly `py.py`_ and `translatorshell.py`_
+`pypy/bin/`_                       command-line scripts, mainly `py.py`_ and `translatorshell.py`_
 
-`config/`_                     handles the numerous options for building and running PyPy
+`pypy/config/`_                    handles the numerous options for building and running PyPy
 
-`doc/`_                        text versions of PyPy developer documentation
+`pypy/doc/`_                       text versions of PyPy developer documentation
 
-`doc/config/`_                 documentation for the numerous translation options
+`pypy/doc/config/`_                documentation for the numerous translation options
 
-`doc/discussion/`_             drafts of ideas and documentation
+`pypy/doc/discussion/`_            drafts of ideas and documentation
 
-``doc/*/``                     other specific documentation topics or tools
+``doc/*/``                         other specific documentation topics or tools
 
-`interpreter/`_                `bytecode interpreter`_ and related objects
-                               (frames, functions, modules,...) 
+`pypy/interpreter/`_               `bytecode interpreter`_ and related objects
+                                   (frames, functions, modules,...) 
 
-`interpreter/pyparser/`_       interpreter-level Python source parser
+`pypy/interpreter/pyparser/`_      interpreter-level Python source parser
 
-`interpreter/astcompiler/`_    interpreter-level bytecode compiler, via an AST
-                               representation
+`pypy/interpreter/astcompiler/`_   interpreter-level bytecode compiler, via an AST
+                                   representation
 
-`module/`_                     contains `mixed modules`_ implementing core modules with 
-                               both application and interpreter level code.
-                               Not all are finished and working.  Use the ``--withmod-xxx``
-                               or ``--allworkingmodules`` translation options.
+`pypy/module/`_                    contains `mixed modules`_ implementing core modules with 
+                                   both application and interpreter level code.
+                                   Not all are finished and working.  Use the ``--withmod-xxx``
+                                   or ``--allworkingmodules`` translation options.
 
-`objspace/`_                   `object space`_ implementations
+`pypy/objspace/`_                  `object space`_ implementations
 
-`objspace/trace.py`_           the `trace object space`_ monitoring bytecode and space operations
+`pypy/objspace/trace.py`_          the `trace object space`_ monitoring bytecode and space operations
 
-`objspace/dump.py`_            the dump object space saves a large, searchable log file
-                               with all operations
+`pypy/objspace/dump.py`_           the dump object space saves a large, searchable log file
+                                   with all operations
 
-`objspace/taint.py`_           the `taint object space`_, providing object tainting
+`pypy/objspace/taint.py`_          the `taint object space`_, providing object tainting
 
-`objspace/thunk.py`_           the `thunk object space`_, providing unique object features 
+`pypy/objspace/thunk.py`_          the `thunk object space`_, providing unique object features 
 
-`objspace/flow/`_              the FlowObjSpace_ implementing `abstract interpretation`_
+`pypy/objspace/flow/`_             the FlowObjSpace_ implementing `abstract interpretation`_
 
-`objspace/std/`_               the StdObjSpace_ implementing CPython's objects and types
+`pypy/objspace/std/`_              the StdObjSpace_ implementing CPython's objects and types
 
-`rlib/`_                       a `"standard library"`_ for RPython_ programs
+`pypy/rlib/`_                      a `"standard library"`_ for RPython_ programs
 
-`rpython/`_                    the `RPython Typer`_ 
+`pypy/rpython/`_                   the `RPython Typer`_ 
 
-`rpython/lltypesystem/`_       the `low-level type system`_ for C-like backends
+`pypy/rpython/lltypesystem/`_      the `low-level type system`_ for C-like backends
 
-`rpython/ootypesystem/`_       the `object-oriented type system`_ for OO backends
+`pypy/rpython/ootypesystem/`_      the `object-oriented type system`_ for OO backends
 
-`rpython/memory/`_             the `garbage collector`_ construction framework
+`pypy/rpython/memory/`_            the `garbage collector`_ construction framework
 
-`tool/`_                       various utilities and hacks used from various places 
+`pypy/tool/`_                      various utilities and hacks used from various places 
 
-`tool/algo/`_                  general-purpose algorithmic and mathematic
-                               tools
+`pypy/tool/algo/`_                 general-purpose algorithmic and mathematic
+                                   tools
 
-`tool/pytest/`_                support code for our `testing methods`_
+`pypy/tool/pytest/`_               support code for our `testing methods`_
 
-`translator/`_                 translation_ backends and support code
+`pypy/translator/`_                translation_ backends and support code
 
-`translator/backendopt/`_      general optimizations that run before a backend generates code
+`pypy/translator/backendopt/`_     general optimizations that run before a backend generates code
 
-`translator/c/`_               the `GenC backend`_, producing C code from an
-                               RPython program (generally via the rtyper_)
+`pypy/translator/c/`_              the `GenC backend`_, producing C code from an
+                                   RPython program (generally via the rtyper_)
 
-`translator/cli/`_             the `CLI backend`_ for `.NET`_ (Microsoft CLR or Mono_)
+`pypy/translator/cli/`_            the `CLI backend`_ for `.NET`_ (Microsoft CLR or Mono_)
 
-`translator/goal/`_            our `main PyPy-translation scripts`_ live here
+`pypy/translator/goal/`_           our `main PyPy-translation scripts`_ live here
 
-`translator/jvm/`_             the Java backend
+`pypy/translator/jvm/`_            the Java backend
 
-`translator/stackless/`_       the `Stackless Transform`_
+`pypy/translator/stackless/`_      the `Stackless Transform`_
 
-`translator/tool/`_            helper tools for translation, including the Pygame
-                               `graph viewer`_
+`pypy/translator/tool/`_           helper tools for translation, including the Pygame
+                                   `graph viewer`_
 
-``*/test/``                    many directories have a test subdirectory containing test 
-                               modules (see `Testing in PyPy`_) 
+``*/test/``                        many directories have a test subdirectory containing test 
+                                   modules (see `Testing in PyPy`_) 
 
-``_cache/``                    holds cache files from internally `translating application 
-                               level to interpreterlevel`_ code.   
-============================   =========================================== 
+``_cache/``                        holds cache files from internally `translating application 
+                                   level to interpreterlevel`_ code.   
+================================   =========================================== 
 
 .. _`bytecode interpreter`: interpreter.html
 .. _`translating application level to interpreterlevel`: geninterp.html

diff --git a/pypy/doc/configuration.rst b/pypy/doc/configuration.rst
--- a/pypy/doc/configuration.rst
+++ b/pypy/doc/configuration.rst
@@ -186,9 +186,8 @@
 The two large parts of PyPy, the standard interpreter and the translation
 toolchain, have two separate sets of options. The translation toolchain options
 can be found on the ``config`` attribute of all ``TranslationContext``
-instances and are described in translationoption.py_. The interpreter options
+instances and are described in `pypy/config/translationoption.py`_. The interpreter options
 are attached to the object space, also under the name ``config`` and are
-described in pypyoption.py_.
+described in `pypy/config/pypyoption.py`_.
 
-.. _translationoption.py: ../config/translationoption.py
-.. _pypyoption.py: ../config/pypyoption.py
+.. include:: _ref.rst

diff --git a/pypy/doc/rtyper.rst b/pypy/doc/rtyper.rst
--- a/pypy/doc/rtyper.rst
+++ b/pypy/doc/rtyper.rst
@@ -66,7 +66,7 @@
 each operation.  In both cases the analysis of an operation depends on the
 annotations of its input arguments.  This is reflected in the usage of the same
 ``__extend__`` syntax in the source files (compare e.g.
-`annotation/binaryop.py`_ and `rpython/rint.py`_).
+`pypy/annotation/binaryop.py`_ and `pypy/rpython/rint.py`_).
 
 The analogy stops here, though: while it runs, the Annotator is in the middle
 of computing the annotations, so it might need to reflow and generalize until
@@ -104,7 +104,7 @@
 implementations for the same high-level operations.  This is the reason for
 turning representations into explicit objects.
 
-The base Repr class is defined in `rpython/rmodel.py`_.  Most of the
+The base Repr class is defined in `pypy/rpython/rmodel.py`_.  Most of the
 ``rpython/r*.py`` files define one or a few subclasses of Repr.  The method
 getrepr() of the RTyper will build and cache a single Repr instance per
 SomeXxx() instance; moreover, two SomeXxx() instances that are equal get the
@@ -131,9 +131,9 @@
 The RPython Typer uses a standard low-level model which we believe can
 correspond rather directly to various target languages such as C.
 This model is implemented in the first part of
-`rpython/lltypesystem/lltype.py`_.
+`pypy/rpython/lltypesystem/lltype.py`_.
 
-The second part of `rpython/lltypesystem/lltype.py`_ is a runnable
+The second part of `pypy/rpython/lltypesystem/lltype.py`_ is a runnable
 implementation of these types, for testing purposes.  It allows us to write
 and test plain Python code using a malloc() function to obtain and manipulate
 structures and arrays.  This is useful for example to implement and test
@@ -191,7 +191,7 @@
 types like list in this elementary world.  The ``malloc()`` function is a kind
 of placeholder, which must eventually be provided by the code generator for the
 target platform; but as we have just seen its Python implementation in
-`rpython/lltypesystem/lltype.py`_ works too, which is primarily useful for
+`pypy/rpython/lltypesystem/lltype.py`_ works too, which is primarily useful for
 testing, interactive exploring, etc.
 
 The argument to ``malloc()`` is the structure type directly, but it returns a
@@ -316,7 +316,7 @@
 with care: the bigger structure of which they are part of could be freed while
 the Ptr to the substructure is still in use.  In general, it is a good idea to
 avoid passing around pointers to inlined substructures of malloc()ed structures.
-(The testing implementation of `rpython/lltypesystem/lltype.py`_ checks to some
+(The testing implementation of `pypy/rpython/lltypesystem/lltype.py`_ checks to some
 extent that you are not trying to use a pointer to a structure after its
 container has been freed, using weak references.  But pointers to non-GC
 structures are not officially meant to be weak references: using them after what
@@ -429,7 +429,7 @@
 change needed to the Annotator to allow it to perform type inference of our
 very-low-level snippets of code.
 
-See for example `rpython/rlist.py`_.
+See for example `pypy/rpython/rlist.py`_.
 
 
 .. _`oo type`:
@@ -441,10 +441,10 @@
 targeting low level backends such as C, but it is not good
 enough for targeting higher level backends such as .NET CLI or Java
 JVM, so a new object oriented model has been introduced. This model is
-implemented in the first part of `rpython/ootypesystem/ootype.py`_.
+implemented in the first part of `pypy/rpython/ootypesystem/ootype.py`_.
 
 As for the low-level typesystem, the second part of
-`rpython/ootypesystem/ootype.py`_ is a runnable implementation of
+`pypy/rpython/ootypesystem/ootype.py`_ is a runnable implementation of
 these types, for testing purposes.
 
 

diff --git a/pypy/doc/tool/makeref.py b/pypy/doc/tool/makeref.py
--- a/pypy/doc/tool/makeref.py
+++ b/pypy/doc/tool/makeref.py
@@ -5,20 +5,13 @@
 pypydir = py.path.local(pypy.__file__).dirpath()
 distdir = pypydir.dirpath() 
 issue_url = 'http://codespeak.net/issue/pypy-dev/' 
+bitbucket_url = 'https://bitbucket.org/pypy/pypy/src/default/'
 
 import urllib2, posixpath
 
 
-possible_start_dirs = [
-    distdir,
-    distdir.join('pypy'),
-    # for now, let the jit links point to the oo-jit branch
-    'http://codespeak.net/svn/pypy/branch/oo-jit',
-    'http://codespeak.net/svn/pypy/branch/oo-jit/pypy',
-    ]
-
 def makeref(docdir):
-    reffile = docdir.join('_ref.txt') 
+    reffile = docdir.join('_ref.rst') 
 
     linkrex = py.std.re.compile('`(\S+)`_')
 
@@ -31,35 +24,19 @@
         name2target.setdefault(linktarget, []).append(linkname)
 
     for textfile in docdir.listdir():  # for subdirs, see below
-        if textfile.ext != '.txt':
+        if textfile.ext != '.rst':
             continue
-        for linkname in linkrex.findall(textfile.read()): 
-            if '/' in linkname: 
-                for startdir in possible_start_dirs:
-                    if isinstance(startdir, str):
-                        assert startdir.startswith('http://')
-                        target = posixpath.join(startdir, linkname)
-                        try:
-                            urllib2.urlopen(target).close()
-                        except urllib2.HTTPError:
-                            continue
-                    else:
-                        cand = startdir.join(linkname)
-                        if not cand.check():
-                            continue
-                        assert cand.relto(distdir)
-                        dotdots = 0
-                        p = docdir
-                        while p != distdir:
-                            p = p.dirpath()
-                            dotdots += 1
-                        target = '../' * dotdots + cand.relto(distdir)
-                    addlink(linkname, target) 
-                    break
-                else: 
-                    print "WARNING %s: link %r may be bogus" %(textfile, linkname) 
+        content = textfile.read()
+        found = False
+        for linkname in linkrex.findall(content): 
+            if '/' in linkname:
+                found = True
+                addlink(linkname, bitbucket_url + linkname)
             elif linkname.startswith('issue'): 
+                found = True
                 addlink(linkname, issue_url+linkname)
+        if found:
+            assert ".. include:: _ref.rst" in content, "you need to include _ref.rst in %s" % (textfile, )
 
     items = name2target.items() 
     items.sort() 

diff --git a/pypy/doc/rlib.rst b/pypy/doc/rlib.rst
--- a/pypy/doc/rlib.rst
+++ b/pypy/doc/rlib.rst
@@ -14,13 +14,11 @@
 to change at some point.  Usually it is useful to look at the tests in
 `pypy/rlib/test`_ to get an impression of how to use a module.
 
-.. _`pypy/rlib`: ../../../../pypy/rlib
-.. _`pypy/rlib/test`: ../../../../pypy/rlib/test
 
 ``listsort``
 ============
 
-The listsort_ module contains an implementation of the timsort sorting algorithm
+The `pypy/rlib/listsort.py`_ module contains an implementation of the timsort sorting algorithm
 (the sort method of lists is not RPython). To use it, subclass from the
 ``listsort.TimSort`` class and override the ``lt`` method to change the
 comparison behaviour. The constructor of ``TimSort`` takes a list as an
@@ -29,19 +27,16 @@
 be sorted using the ``listsort`` module in one program, otherwise the annotator
 will be confused.
 
-.. _listsort: ../../../../pypy/rlib/listsort.py
-
 ``nonconst``
 ============
 
-The nonconst_ module is useful mostly for tests. The `flow object space`_ and
+The `pypy/rlib/nonconst.py`_ module is useful mostly for tests. The `flow object space`_ and
 the `annotator`_ do quite some constant folding, which is sometimes not desired
 in a test. To prevent constant folding on a certain value, use the ``NonConst``
 class. The constructor of ``NonConst`` takes an arbitrary value. The instance of
 ``NonConst`` will behave during annotation like that value, but no constant
 folding will happen.
 
-.. _nonconst: ../../../../pypy/rlib/nonconst.py
 .. _`flow object space`: objspace.html#the-flow-object-space
 .. _`annotator`: translation.html#the-annotation-pass
 
@@ -49,7 +44,7 @@
 ``objectmodel``
 ===============
 
-The objectmodel_ module is a mixed bag of various functionality. Some of the
+The `pypy/rlib/objectmodel.py`_ module is a mixed bag of various functionality. Some of the
 more useful ones are:
 
 ``ComputedIntSymbolic``:
@@ -95,24 +90,21 @@
     won't be allocated but represented by *tagged pointers**, that is pointers
     that have the lowest bit set.
 
-.. _objectmodel: ../../../../pypy/rlib/objectmodel.py
-
 
 ``rarithmetic``
 ===============
 
-The rarithmetic_ module contains functionality to handle the small differences
+The `pypy/rlib/rarithmetic.py`_ module contains functionality to handle the small differences
 in the behaviour of arithmetic code in regular Python and RPython code. Most of
 them are already described in the `coding guide`_
 
-.. _rarithmetic: ../../../../pypy/rlib/rarithmetic.py
 .. _`coding guide`: coding-guide.html
 
 
 ``rbigint``
 ===========
 
-The rbigint module contains a full RPython implementation of the Python ``long``
+The `pypy/rlib/rbigint.py`_ module contains a full RPython implementation of the Python ``long``
 type (which itself is not supported in RPython). The ``rbigint`` class contains
 that implementation. To construct ``rbigint`` instances use the static methods
 ``fromint``, ``frombool``, ``fromfloat`` and ``fromdecimalstr``. To convert back
@@ -122,36 +114,30 @@
 these underscores left out for better readability (so ``a.add(b)`` can be used
 to add two rbigint instances).
 
-.. _rbigint: ../../../../pypy/rlib/rbigint.py
-
 
 ``rrandom``
 ===========
 
-The rrandom_ module contains an implementation of the mersenne twister random
+The `pypy/rlib/rrandom.py`_ module contains an implementation of the mersenne twister random
 number generator. It contains one class ``Random`` which most importantly has a
 ``random`` method which returns a pseudo-random floating point number between
 0.0 and 1.0.
 
-.. _rrandom: ../../../../pypy/rlib/rrandom.py
-
 ``rsocket``
 ===========
 
-The rsocket_ module contains an RPython implementation of the functionality of
+The `pypy/rlib/rsocket.py`_ module contains an RPython implementation of the functionality of
 the socket standard library with a slightly different interface.  The
 difficulty with the Python socket API is that addresses are not "well-typed"
 objects: depending on the address family they are tuples, or strings, and
 so on, which is not suitable for RPython.  Instead, ``rsocket`` contains
 a hierarchy of Address classes, in a typical static-OO-programming style.
 
-.. _rsocket: ../../../../pypy/rlib/rsocket.py
-
 
 ``rstack``
 ==========
 
-The rstack_ module allows an RPython program to control its own execution stack.
+The `pypy/rlib/rstack.py`_ module allows an RPython program to control its own execution stack.
 This is only useful if the program is translated using stackless. An old
 description of the exposed functions is below.
 
@@ -210,32 +196,28 @@
 
     f()
 
-.. _rstack: ../../../../pypy/rlib/rstack.py
-
 
 ``streamio``
 ============
 
-The streamio_ contains an RPython stream I/O implementation (which was started
+The `pypy/rlib/streamio.py`_ contains an RPython stream I/O implementation (which was started
 by Guido van Rossum as `sio.py`_ in the CPython sandbox as a prototype for the
 upcoming new file implementation in Python 3000).
 
-.. _streamio: ../../../../pypy/rlib/streamio.py
 .. _`sio.py`: http://svn.python.org/view/sandbox/trunk/sio/sio.py
 
 ``unroll``
 ==========
 
-The unroll_ module most importantly contains the function ``unrolling_iterable``
+The `pypy/rlib/unroll.py`_ module most importantly contains the function ``unrolling_iterable``
 which wraps an iterator. Looping over the iterator in RPython code will not
 produce a loop in the resulting flow graph but will unroll the loop instead.
 
-.. _unroll: ../../../../pypy/rlib/unroll.py
 
 ``parsing``
 ===========
 
-The parsing_ module is a still in-development module to generate tokenizers and
+The `pypy/rlib/parsing/`_ module is a still in-development module to generate tokenizers and
 parsers in RPython. It is still highly experimental and only really used by the
 `Prolog interpreter`_ (although in slightly non-standard ways). The easiest way
 to specify a tokenizer/grammar is to write it down using regular expressions and
@@ -348,7 +330,7 @@
 
 The parsing process builds up a tree consisting of instances of ``Symbol`` and
 ``Nonterminal``, the former corresponding to tokens, the latter to nonterminal
-symbols. Both classes live in the `pypy.rlib.parsing.tree`_ module. You can use
+symbols. Both classes live in the `pypy/rlib/parsing/tree.py`_ module. You can use
 the ``view()`` method ``Nonterminal`` instances to get a pygame view of the
 parse tree.
 
@@ -359,13 +341,11 @@
 of the nonterminal and ``children`` which is a list of the children attributes.
 
 
-.. _`pypy.rlib.parsing.tree`: ../../../../pypy/rlib/parsing/tree.py
-
 Visitors
 ++++++++
 
 To write tree visitors for the parse trees that are RPython, there is a special
-baseclass ``RPythonVisitor`` in ``pypy.rlib.parsing.tree``_ to use. If your
+baseclass ``RPythonVisitor`` in `pypy/rlib/parsing/tree.py`_ to use. If your
 class uses this, it will grow a ``dispatch(node)`` method, that calls an
 appropriate ``visit_<symbol>`` method, depending on the ``node`` argument. Here
 the <symbol> is replaced by the ``symbol`` attribute of the visited node.
@@ -531,5 +511,6 @@
 
 
 .. _`Prolog interpreter`: https://bitbucket.org/cfbolz/pyrolog/
-.. _parsing: ../../../../pypy/rlib/parsing/
 .. _`json format`: http://www.json.org
+
+.. include:: _ref.rst

diff --git a/pypy/doc/coding-guide.rst b/pypy/doc/coding-guide.rst
--- a/pypy/doc/coding-guide.rst
+++ b/pypy/doc/coding-guide.rst
@@ -352,9 +352,6 @@
 silent wrap-around.  Whenever we need more control, we use the following
 helpers (which live the `pypy/rlib/rarithmetic.py`_):
 
-.. _`pypy/rlib/rarithmetic.py`: ../../../../pypy/rlib/rarithmetic.py
-
-
 **ovfcheck()**
 
   This special function should only be used with a single arithmetic operation
@@ -887,6 +884,8 @@
 for the next milestone, both from an E-Mail and from a
 web interface.
 
+.. _`development tracker`: https://codespeak.net/issue/pypy-dev/
+
 use your codespeak login or register
 ------------------------------------
 

diff --git a/pypy/doc/objspace.rst b/pypy/doc/objspace.rst
--- a/pypy/doc/objspace.rst
+++ b/pypy/doc/objspace.rst
@@ -56,7 +56,7 @@
 
 The present document gives a description of the above object spaces.
 The sources of PyPy contain the various object spaces in the directory
-`objspace/`_.
+`pypy/objspace/`_.
 
 To choose which object space to use, use the :config:`objspace.name` option.
 
@@ -297,7 +297,7 @@
 Introduction
 ------------
 
-The Standard Object Space (StdObjSpace_) is the direct equivalent of CPython's
+The Standard Object Space (`pypy/objspace/std/`_) is the direct equivalent of CPython's
 object library (the "Objects/" subdirectory in the distribution). It is an
 implementation of the common Python types in a lower-level language.
 
@@ -341,13 +341,11 @@
 using plain integers instead is the complex path, not the other way
 around.
 
-.. _StdObjSpace: ../../../../pypy/objspace/std/
-
 
 Object types
 ------------
 
-The larger part of the `StdObjSpace`_ package defines and implements the
+The larger part of the `pypy/objspace/std/`_ package defines and implements the
 library of Python's standard built-in object types.  Each type (int, float,
 list, tuple, str, type, etc.) is typically implemented by two modules:
 
@@ -356,17 +354,17 @@
 * the *implementation* module, called ``xxxobject.py``.
 
 The ``xxxtype.py`` module basically defines the type object itself.  For
-example, `listtype.py`_ contains the specification of the object you get when
-you type ``list`` in a PyPy prompt.  `listtype.py`_ enumerates the methods
+example, `pypy/objspace/std/listtype.py`_ contains the specification of the object you get when
+you type ``list`` in a PyPy prompt.  `pypy/objspace/std/listtype.py`_ enumerates the methods
 specific to lists, like ``append()``.
 
 A particular method implemented by all types is the ``__new__()`` special
 method, which in Python's new-style-classes world is responsible for creating
 an instance of the type.  In PyPy, ``__new__()`` locates and imports the module
 implementing *instances* of the type, and creates such an instance based on the
-arguments the user supplied to the constructor.  For example, `tupletype.py`_
+arguments the user supplied to the constructor.  For example, `pypy/objspace/std/tupletype.py`_
 defines ``__new__()`` to import the class ``W_TupleObject`` from
-`tupleobject.py`_ and instantiate it.  The `tupleobject.py`_ then contains a
+`pypy/objspace/std/tupleobject.py`_ and instantiate it.  The `pypy/objspace/std/tupleobject.py`_ then contains a
 "real" implementation of tuples: the way the data is stored in the
 ``W_TupleObject`` class, how the operations work, etc.
 
@@ -387,18 +385,13 @@
 same Python type.  PyPy knows that (e.g.) the application-level type of
 its interpreter-level ``W_StringObject`` instances is str because
 there is a ``typedef`` class attribute in ``W_StringObject`` which
-points back to the string type specification from `stringtype.py`_; all
+points back to the string type specification from `pypy/objspace/std/stringtype.py`_; all
 other implementations of strings use the same ``typedef`` from
-`stringtype.py`_.
+`pypy/objspace/std/stringtype.py`_.
 
 For other examples of multiple implementations of the same Python type,
 see `Standard Interpreter Optimizations`_.
 
-.. _`listtype.py`: ../../../../pypy/objspace/std/listtype.py
-.. _`stringtype.py`: ../../../../pypy/objspace/std/stringtype.py
-.. _`tupletype.py`: ../../../../pypy/objspace/std/tupletype.py
-.. _`tupleobject.py`: ../../../../pypy/objspace/std/tupleobject.py
-
 .. _`Standard Interpreter Optimizations`: interpreter-optimizations.html
 
 
@@ -408,12 +401,10 @@
 The Standard Object Space allows multiple object implementations per
 Python type - this is based on multimethods_.  For a description of the
 multimethod variant that we implemented and which features it supports,
-see the comment at the start of the source__.  However, multimethods
+see the comment at the start of `pypy/objspace/std/multimethod.py`_.  However, multimethods
 alone are not enough for the Standard Object Space: the complete picture
 spans several levels in order to emulate the exact Python semantics.
 
-.. __: ../../../../pypy/objspace/std/multimethod.py
-
 Consider the example of the ``space.getitem(w_a, w_b)`` operation,
 corresponding to the application-level syntax ``a[b]``.  The Standard
 Object Space contains a corresponding ``getitem`` multimethod and a
@@ -552,13 +543,11 @@
 operations are usually shown.   
 
 A quick introduction on how to use the trace object space can be `found here`_.
-A number of options for configuration is here in `traceconfig.py`_.
+A number of options for configuration is here in `pypy/tool/traceconfig.py`_.
 
 
 .. _`found here` : getting-started-dev.html#tracing-bytecode-and-operations-on-objects
 .. _`Abstract Interpretation`: http://en.wikipedia.org/wiki/Abstract_interpretation
-.. _`traceconfig.py`: ../tool/traceconfig.py
-
 
 .. _`Flow Object Space`:
 
@@ -568,7 +557,7 @@
 Introduction
 ------------
 
-The task of the FlowObjSpace_ is to generate a control-flow graph from a
+The task of the FlowObjSpace (the source is at `pypy/objspace/flow/`_) is to generate a control-flow graph from a
 function.  This graph will also contain a trace of the individual operations, so
 that it is actually just an alternate representation for the function.
 
@@ -600,8 +589,6 @@
     v3 = add(v2, Constant(2))
 
 
-.. _FlowObjSpace: ../../../../pypy/objspace/flow/
-
 
 The Flow model
 --------------


More information about the Pypy-commit mailing list