Browse Source

Adjust document format, pypi seems don't like 'code:: sh'

Matthew Wang 10 years ago
parent
commit
3309c601b5
1 changed files with 29 additions and 21 deletions
  1. 29
    21
      README.rst

+ 29
- 21
README.rst View File

24
 Install with pip
24
 Install with pip
25
 ~~~~~~~~~~~~~~~~
25
 ~~~~~~~~~~~~~~~~
26
 
26
 
27
-Cdiff is already listed on `PyPI <http://pypi.python.org/pypi/cdiff>`_, you can
28
-install with ``pip`` if you have the tool.
27
+Cdiff is already listed on `PyPI`_, you can install with ``pip`` if you have
28
+the tool.
29
 
29
 
30
-.. code:: sh
30
+.. _PyPI: http://pypi.python.org/pypi/cdiff
31
+
32
+.. code-block:: bash
31
 
33
 
32
     pip install --upgrade cdiff
34
     pip install --upgrade cdiff
33
 
35
 
36
 
38
 
37
 You can also run the setup.py from the source if you don't have ``pip``.
39
 You can also run the setup.py from the source if you don't have ``pip``.
38
 
40
 
39
-.. code:: sh
41
+.. code-block:: bash
40
 
42
 
41
     git clone https://github.com/ymattw/cdiff.git
43
     git clone https://github.com/ymattw/cdiff.git
42
     cd cdiff
44
     cd cdiff
45
 Download directly
47
 Download directly
46
 ~~~~~~~~~~~~~~~~~
48
 ~~~~~~~~~~~~~~~~~
47
 
49
 
48
-Just save `cdiff.py <https://raw.github.com/ymattw/cdiff/master/cdiff.py>`_ to
49
-whatever directory which is in your ``$PATH``, for example, ``$HOME/bin`` is in
50
-my ``$PATH``, so I save the script there and name as ``cdiff``.
50
+Just save `cdiff.py`_ to whatever directory which is in your ``$PATH``, for
51
+example, ``$HOME/bin`` is in my ``$PATH``, so I save the script there and name
52
+as ``cdiff``.
53
+
54
+.. _`cdiff.py`: https://raw.github.com/ymattw/cdiff/master/cdiff.py
51
 
55
 
52
-.. code:: sh
56
+.. code-block:: bash
53
 
57
 
54
-    curl -sSL https://raw.github.com/ymattw/cdiff/master/cdiff.py > ~/bin/cdiff
58
+    curl -ksSL https://raw.github.com/ymattw/cdiff/master/cdiff.py > ~/bin/cdiff
55
     chmod +x ~/bin/cdiff
59
     chmod +x ~/bin/cdiff
56
 
60
 
57
 Usage
61
 Usage
81
 Read diff from local modification in a *Git/Mercurial/Svn* workspace (output
85
 Read diff from local modification in a *Git/Mercurial/Svn* workspace (output
82
 from e.g. ``git diff``, ``svn diff``):
86
 from e.g. ``git diff``, ``svn diff``):
83
 
87
 
84
-.. code:: sh
88
+.. code-block:: bash
85
 
89
 
86
     cd proj-workspace
90
     cd proj-workspace
87
     cdiff                       # view colored incremental diff
91
     cdiff                       # view colored incremental diff
97
 Read log with changes in a *Git/Mercurial/Svn* workspace (output from e.g.
101
 Read log with changes in a *Git/Mercurial/Svn* workspace (output from e.g.
98
 ``git log -p``, ``svn log --diff``), note *--diff* option is new in svn 1.7.0:
102
 ``git log -p``, ``svn log --diff``), note *--diff* option is new in svn 1.7.0:
99
 
103
 
100
-.. code:: sh
104
+.. code-block:: bash
101
 
105
 
102
     cd proj-workspace
106
     cd proj-workspace
103
     cdiff -l                    # read log along with changes
107
     cdiff -l                    # read log along with changes
107
 
111
 
108
 Pipe in a diff:
112
 Pipe in a diff:
109
 
113
 
110
-.. code:: sh
114
+.. code-block:: bash
111
 
115
 
112
     git log -p -2 | cdiff       # view git log with changes of last 2 commits
116
     git log -p -2 | cdiff       # view git log with changes of last 2 commits
113
     git show 15bfa | cdiff -s   # view a given git commit, side by side
117
     git show 15bfa | cdiff -s   # view a given git commit, side by side
126
 
130
 
127
 Redirect output to another patch file is safe:
131
 Redirect output to another patch file is safe:
128
 
132
 
129
-.. code:: sh
133
+.. code-block:: bash
130
 
134
 
131
     svn diff -r PREV | cdiff -s > my.patch
135
     svn diff -r PREV | cdiff -s > my.patch
132
 
136
 
142
 
146
 
143
 Pull requests are very welcome, please make sure your changes can pass unit
147
 Pull requests are very welcome, please make sure your changes can pass unit
144
 tests and regression tests by run ``make test`` (required tool *coverage* can
148
 tests and regression tests by run ``make test`` (required tool *coverage* can
145
-be installed with ``pip install coverage``).  Also watch out `travis build
146
-<https://travis-ci.org/ymattw/cdiff/pull_requests>`_ after push, make sure it
147
-passes as well.
149
+be installed with ``pip install coverage``).  Also watch out `travis build`_
150
+after push, make sure it passes as well.
151
+
152
+.. _`travis build`: https://travis-ci.org/ymattw/cdiff/pull_requests
148
 
153
 
149
 See also
154
 See also
150
 --------
155
 --------
151
 
156
 
152
-I have another tool `coderev <https://github.com/ymattw/coderev>`_ which
153
-generates side-by-side diff pages for code review from two given files or
154
-directories, I found it's not easy to extend to support git so invented
155
-`cdiff`.  Idea of ansi color markup is also from project `colordiff
156
-<https://github.com/daveewart/colordiff>`_.
157
+I have another tool `coderev`_ which generates side-by-side diff pages for code
158
+review from two given files or directories, I found it's not easy to extend to
159
+support git so invented `cdiff`.  Idea of ansi color markup is also from
160
+project `colordiff`_.
161
+
162
+.. _coderev: https://github.com/ymattw/coderev
163
+.. _colordiff: https://github.com/daveewart/colordiff
157
 
164
 
165
+.. vim:set ft=rst et sw=4 sts=4 tw=79: