Skip to content

Commit 10d0370

Browse files
committed
Merge pull request realpython#406 from Zearin/markup-file
Mark up files & directories
2 parents a61d9ad + cc7b193 commit 10d0370

File tree

13 files changed

+69
-68
lines changed

13 files changed

+69
-68
lines changed

docs/dev/env.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Vim is a text editor which uses keyboard shortcuts for editing instead of menus
1616
or icons. There exist a couple of plugins and settings for the VIM editor to
1717
aid Python development. If you only develop in Python, a good start is to set
1818
the default settings for indentation and line-wrapping to values compliant with
19-
:pep:`8`. In your home directory, open a file called ``.vimrc`` and add the
19+
:pep:`8`. In your home directory, open a file called :file:`.vimrc` and add the
2020
following lines::
2121

2222
set textwidth=79 " lines longer than 79 columns will be broken
@@ -46,7 +46,7 @@ install vim-pyflakes_. Now you can map the functions ``Pep8()`` or ``Pyflakes()`
4646
to any hotkey or action you want in Vim. Both plugins will display errors at
4747
the bottom of the screen, and provide an easy way to jump to the corresponding
4848
line. It's very handy to call these functions whenever you save a file. In
49-
order to do this, add the following lines to your ``.vimrc``::
49+
order to do this, add the following lines to your :file:`.vimrc`::
5050

5151
autocmd BufWritePost *.py call Pyflakes()
5252
autocmd BufWritePost *.py call Pep8()
@@ -253,7 +253,7 @@ the current state of the environment packages. To do this, run
253253
254254
$ pip freeze > requirements.txt
255255
256-
This will create a ``requirements.txt`` file, which contains a simple
256+
This will create a :file:`requirements.txt` file, which contains a simple
257257
list of all the packages in the current environment, and their respective
258258
versions. Later, when a different developer (or you, if you need to re-
259259
create the environment) can install the same packages, with the same

docs/dev/virtualenvs.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Basic Usage
3030
$ virtualenv venv
3131
3232
This creates a copy of Python in whichever directory you ran the command in,
33-
placing it in a folder named ``venv``.
33+
placing it in a folder named :file:`venv`.
3434

3535
2. To begin using the virtual environment, it needs to be activated:
3636

@@ -94,7 +94,7 @@ Basic Usage
9494
9595
$ mkvirtualenv venv
9696
97-
This creates the ``venv`` folder inside ``~/Envs``.
97+
This creates the :file:`venv` folder inside :file:`~/Envs`.
9898

9999
2. Work on a virtual environment:
100100

@@ -105,6 +105,7 @@ This creates the ``venv`` folder inside ``~/Envs``.
105105
**virtualenvwrapper** provides tab-completion on environment names. It really
106106
helps when you have a lot of environments and have trouble remembering their
107107
names.
108+
108109
``workon`` also deactivates whatever environment you are currently in, so you
109110
can quickly switch between environments.
110111

@@ -128,19 +129,19 @@ Other useful commands
128129

129130
``cdvirtualenv``
130131
Navigate into the directory of the currently activated virtual environment,
131-
so you can browse its ``site-packages``, for example.
132+
so you can browse its :file:`site-packages`, for example.
132133

133134
``cdsitepackages``
134-
Like the above, but directly into ``site-packages`` directory.
135+
Like the above, but directly into :file:`site-packages` directory.
135136

136137
``lssitepackages``
137-
Shows contents of ``site-packages`` directory.
138+
Shows contents of :file:`site-packages` directory.
138139

139140
`Full list of virtualenvwrapper commands <http://virtualenvwrapper.readthedocs.org/en/latest/command_ref.html>`_.
140141

141142
autoenv
142143
-------
143-
When you ``cd`` into a directory containing a ``.env``, `autoenv <https://github.com/kennethreitz/autoenv>`_
144+
When you ``cd`` into a directory containing a :file:`.env`, `autoenv <https://github.com/kennethreitz/autoenv>`_
144145
automagically activates the environment.
145146

146147
Install it on Mac OS X using ``brew``:

docs/scenarios/admin.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ server.
3838
run('git pull')
3939
run('touch app.wsgi')
4040
41-
With the previous code saved in a file named fabfile.py, we can check memory
41+
With the previous code saved in a file named :file:`fabfile.py`, we can check memory
4242
usage with:
4343

4444
.. code-block:: console

docs/scenarios/ci.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Requests whether this particular changeset breaks the build or not. So if you ar
6060
hosting your code on Github, travis-ci is a great and easy way to get started with
6161
Continuous Integration.
6262

63-
In order to get started, add a ``.travis.yml`` file to your repository with this
63+
In order to get started, add a :file:`.travis.yml` file to your repository with this
6464
example content::
6565

6666
language: python

docs/scenarios/speed.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ to be compiled into C types while also creating a Python list:
150150
151151
What is the difference? In the upper Cython version you can see the declaration of the variable types and the integer array
152152
in a similar way like in standard C. For example `cdef int n,k,i` in line 3. This additional type declaration (e.g. integer)
153-
allows the Cython compiler to generate more efficient C code from the second code. While standard Python code is saved in `*.py` files,
154-
Cython code is saved in `*.pyx` files.
153+
allows the Cython compiler to generate more efficient C code from the second code. While standard Python code is saved in :file:`*.py` files,
154+
Cython code is saved in :file:`*.pyx` files.
155155

156156
And what is with the speed? So lets try it!
157157

@@ -187,9 +187,9 @@ These both lines need a remark:
187187
pyximport.install()
188188
189189
190-
The `pyximport` module allows you to import `pyx` files (e.g., `primesCy.pyx`) with the Cython-compiled version of the `primes` function.
190+
The `pyximport` module allows you to import :file:`*.pyx` files (e.g., :file:`primesCy.pyx`) with the Cython-compiled version of the `primes` function.
191191
The `pyximport.install()` command allows the Python interpreter to start the Cython compiler directly to generate C-code,
192-
which is automatically compiled to a `*.so` C-library. Cython is able to import this library for you in your Python-code.
192+
which is automatically compiled to a :file:`*.so` C-library. Cython is able to import this library for you in your Python-code.
193193
Very easy and very efficient. With the `time.time()` function you are able to compare the time between this 2 different calls to find 500 prime numbers.
194194
On a standard notebook (dual core AMD E-450 1.6 GHz), the measured values are:
195195

docs/scenarios/web.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Gondor
252252
`Gondor <https://gondor.io/>`_ is a PaaS specialized for deploying Django
253253
and Pinax applications. Gondor supports Django versions 1.2 and 1.3 on
254254
Python version 2.7, and can automatically configure your Django site if you
255-
use ``local_settings.py`` for site-specific configuration information.
255+
use :file:`local_settings.py` for site-specific configuration information.
256256

257257
Gondor has a guide on deploying `Django projects <https://gondor.io/support/django/setup/>`_.
258258

@@ -365,7 +365,7 @@ to use.
365365
application.listen(PORT)
366366
tornado.ioloop.IOLoop.instance().start()
367367
368-
The `base.html` file can be used as base for all site pages which are for example implemented in the content block.
368+
The :file:`base.html` file can be used as base for all site pages which are for example implemented in the content block.
369369

370370
.. code-block:: html
371371

@@ -389,8 +389,8 @@ The `base.html` file can be used as base for all site pages which are for exampl
389389
</body>
390390

391391

392-
The next listing is our site page (`site.html`) loaded in the Python app which extends `base.html`. The content block is
393-
automatically set into the corresponding block in the base.html page.
392+
The next listing is our site page (:file:`site.html`) loaded in the Python app which extends :file:`base.html`. The content block is
393+
automatically set into the corresponding block in the :file:`base.html` page.
394394

395395
.. code-block:: html
396396

docs/shipping/freezing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ cx_Freeze yes yes yes yes PSF no yes yes
3838
.. note::
3939
All solutions need MS Visual C++ dll to be installed on target machine.
4040
Only Pyinstaller makes self-executable exe that bundles the dll when
41-
passing ``--onefile`` to `Configure.py`.
41+
passing ``--onefile`` to :file:`Configure.py`.
4242

4343
Windows
4444
-------
@@ -72,7 +72,7 @@ Prerequisite is to install :ref:`Python on Windows <install-windows>`.
7272

7373
4. (Optionally) `one-file mode <http://stackoverflow.com/questions/112698/py2exe-generate-single-executable-file#113014>`_
7474

75-
5. Generate ``.exe`` into ``dist`` directory:
75+
5. Generate :file:`.exe` into :file:`dist` directory:
7676

7777
.. code-block:: console
7878

docs/shipping/packaging.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ running from the directory which holds those packages which need to be installed
3030

3131
**Showing an example is always beneficial**
3232

33-
Say if you are after installing a package called MyPackage.tar.gz, and
33+
Say if you are after installing a package called :file:`MyPackage.tar.gz`, and
3434
assuming this is your directory structure:
3535

3636

@@ -55,7 +55,7 @@ package installer. Using Pip, you would do it like:
5555
5656
Having a folder with the same name as the package name is **crucial** here.
5757
I got fooled by that, one time. But if you feel that creating a folder called
58-
**MyPackage** and keeping **MyPackage.tar.gz** inside that, is *redundant*,
58+
:file:`MyPackage` and keeping :file:`MyPackage.tar.gz` inside that, is *redundant*,
5959
you can still install MyPackage using:
6060

6161
.. code-block:: console
@@ -88,7 +88,7 @@ One simple option for a personal PyPi server is to use Amazon S3. A prerequisite
8888

8989
4. **Upload the new files**
9090

91-
* Use a client like Cyberduck to sync the entire :code:`packages` folder to your s3 bucket
91+
* Use a client like Cyberduck to sync the entire :file:`packages` folder to your s3 bucket
9292
* Make sure you upload :code:`packages/simple/index.html` as well as all new files and directories
9393

9494
5. **Fix new file permissions**

docs/starting/install/osx.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The script will explain what changes it will make and prompt you before the
4747
installation begins.
4848
Once you've installed Homebrew, insert the Homebrew directory at the top
4949
of your ``PATH`` environment variable. You can do this by adding the following
50-
line at the bottom of your ``~/.bashrc`` file
50+
line at the bottom of your :file:`~/.bashrc` file
5151

5252
.. code-block:: console
5353

docs/starting/install/win.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ double-click the file. The MSI package format allows Windows administrators to
1313
automate installation with their standard tools.
1414

1515
By design, Python installs to a directory with the version number embedded,
16-
e.g. Python version 2.7 will install at ``C:\Python27\``, so that you can
16+
e.g. Python version 2.7 will install at :file:`C:\Python27\`, so that you can
1717
have multiple versions of Python on the
1818
same system without conflicts. Of course, only one interpreter can be the
1919
default application for Python file types. It also does not automatically
@@ -22,7 +22,7 @@ which copy of Python is run.
2222

2323
Typing the full path name for a Python interpreter each time quickly gets
2424
tedious, so add the directories for your default Python version to the PATH.
25-
Assuming that your Python installation is in ``C:\Python27\``, add this to your
25+
Assuming that your Python installation is in :file:`C:\Python27\`, add this to your
2626
PATH:
2727
2828
.. code-block:: console
@@ -35,7 +35,7 @@ You can do this easily by running the following in ``powershell``:
3535
3636
[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\;C:\Python27\Scripts\", "User")
3737
38-
The second (``Scripts``) directory receives command files when certain
38+
The second (:file:`Scripts`) directory receives command files when certain
3939
packages are installed, so it is a very useful addition.
4040
You do not need to install or configure anything else to use Python. Having
4141
said that, I would strongly recommend that you install the tools and libraries
@@ -92,14 +92,14 @@ project's directory
9292
9393
> virtualenv venv
9494
95-
To use an environment, run the ``activate.bat`` batch file in the ``Scripts``
95+
To use an environment, run the :file:`activate.bat` batch file in the :file:`Scripts`
9696
subdirectory of that environment. Your command prompt will change to show the
9797
active environment. Once you have finished working in the current virtual
98-
environment, run the ``deactivate.bat`` batch file to restore your settings to
98+
environment, run the :file:`deactivate.bat` batch file to restore your settings to
9999
normal.
100100

101101
Each new environment automatically includes a copy of ``pip`` in the
102-
``Scripts`` subdirectory, so that you can setup the third-party libraries and
102+
:file:`Scripts` subdirectory, so that you can setup the third-party libraries and
103103
tools that you want to use in that environment. Put your own code within a
104104
subdirectory of the environment, however you wish. When you no longer need a
105105
particular environment, simply copy your code out of it, and then delete the

0 commit comments

Comments
 (0)