Skip to content
This repository was archived by the owner on Jun 23, 2022. It is now read-only.

Commit 9445c67

Browse files
committed
add TOC, use kbd, fix table syntax, put example code in literal block
1 parent c05be3f commit 9445c67

File tree

2 files changed

+58
-50
lines changed

2 files changed

+58
-50
lines changed

README.rst

+12-6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ vim-rst-tables
33

44
.. image:: http://stillmaintained.com/nvie/vim-rst-tables.png
55

6+
.. contents:: **Contents**
7+
:local:
8+
9+
610
Installation
711
------------
812
1. Install the following packages from PyPI:
@@ -22,7 +26,7 @@ Installation
2226
4. Copy the file ``ftplugin/rst_tables.vim`` to your ``~/.vim/ftplugin``
2327
directory. If your vim is not already configured to source scripts
2428
in this directory, make sure to add the appropriate command to your
25-
.vimrc::
29+
``.vimrc``::
2630

2731
source "~/.vim/ftplugin/rst_tables.vim"
2832

@@ -48,12 +52,13 @@ Creating a new table
4852
This is paragraph text *after* the table.
4953

5054
2. Put your cursor somewhere in the table.
51-
3. To create the table, press ``,,c`` (or ``\\c`` if vim's <Leader> is set to
52-
the default value). The output will look something like this::
55+
3. To create the table, press :kbd:`,,c` (or :kbd:`\\c` if vim's
56+
:kbd:`&lt;Leader&gt;` is set to the default value). The output will look
57+
something like this::
5358

5459
This is paragraph text *before* the table.
5560

56-
+==========+=========================================================+
61+
+----------+---------------------------------------------------------+
5762
| Column 1 | Column 2 |
5863
+==========+=========================================================+
5964
| Foo | Put two (or more) spaces as a field separator. |
@@ -77,5 +82,6 @@ you can define the column width you would prefer, and re-flow your table.
7782
1. Change the number of "---" signs in the top row of your table to match
7883
the column widths you would prefer.
7984
2. Put your cursor somewhere in the table.
80-
3. Press ``,,f`` to re-flow the table (or ``\\f`` if vim's <Leader> is set to
81-
the default value; see also the :map command).
85+
3. Press :kbd:`,,f` to re-flow the table (or :kbd:`\\f` if vim's
86+
:kbd:`&lt;Leader&gt;` is set to the default value; see also the ``:map``
87+
command).

tutorial.rst

+46-44
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,60 @@
11
Simple example
22
==============
3-
Set your cursor inside the following paragraph and type ",,c":
4-
5-
Feature Description
6-
Easy It's soo easy, man.
7-
Predictable Amount of spaces doesn't matter.
8-
Repeatable It can be repeated.
9-
Flexible Even spaces at the end of a line are fine.
10-
11-
Then, the paragraph should turn into:
12-
13-
+=============+============================================+
14-
| Feature | Description |
15-
+=============+============================================+
16-
| Easy | It's soo easy, man. |
17-
+-------------+--------------------------------------------+
18-
| Predictable | Amount of spaces doesn't matter. |
19-
+-------------+--------------------------------------------+
20-
| Repeatable | It can be repeated. |
21-
+-------------+--------------------------------------------+
22-
| Flexible | Even spaces at the end of a line are fine. |
23-
+-------------+--------------------------------------------+
3+
Set your cursor inside the following paragraph and type :kbd:`,,c`::
4+
5+
Feature Description
6+
Easy It's soo easy, man.
7+
Predictable Amount of spaces doesn't matter.
8+
Repeatable It can be repeated.
9+
Flexible Even spaces at the end of a line are fine.
10+
11+
Then, the paragraph should turn into::
12+
13+
+-------------+--------------------------------------------+
14+
| Feature | Description |
15+
+=============+============================================+
16+
| Easy | It's soo easy, man. |
17+
+-------------+--------------------------------------------+
18+
| Predictable | Amount of spaces doesn't matter. |
19+
+-------------+--------------------------------------------+
20+
| Repeatable | It can be repeated. |
21+
+-------------+--------------------------------------------+
22+
| Flexible | Even spaces at the end of a line are fine. |
23+
+-------------+--------------------------------------------+
2424

2525
Then, fix the "soo" to become "so" and insert the word "really" between
2626
"doesn't" and "matter". Finally, rename "Easy" to "Super easy", so it looks
27-
like this:
27+
like this::
2828

29-
+=============+==================================+
30-
| Feature | Description |
31-
+=============+==================================+
32-
| Super easy | It's so easy, man. |
33-
+-------------+----------------------------------+
34-
| Predictable | Amount of spaces doesn't really matter. |
35-
+-------------+----------------------------------+
36-
| Repeatable | It can be repeated. |
37-
+-------------+----------------------------------+
29+
+-------------+----------------------------------+
30+
| Feature | Description |
31+
+=============+==================================+
32+
| Super easy | It's so easy, man. |
33+
+-------------+----------------------------------+
34+
| Predictable | Amount of spaces doesn't really matter. |
35+
+-------------+----------------------------------+
36+
| Repeatable | It can be repeated. |
37+
+-------------+----------------------------------+
3838

39-
Then, set your cursor inside the table again, and type ,,f to reformat the
40-
table.
39+
Then, set your cursor inside the table again, and type :kbd:`,,f` to reformat
40+
the table.
4141

4242

4343
A more complex example
4444
======================
4545

46-
Feature| Description |
47-
Ease of use | Drop dead simple!
48-
Foo | Bar, qux, mux
49-
Predictability | Deploykdj sfkljsdjf ljdflsk jsdflkj dsflkj sdlkj dfslkj
50-
| | dfslkjds flkdjsfl sdfjlk jdfslk djsfl dfjslk jsdflk jfdslk jdfslkds fjlkds
51-
| | jldkfj ldfsjlsd jldsf jlkjds flds fjlk jdflk jdsflj dslfjs dlfj sdflkj sdlfj
52-
| |dfslkjds flkdjsfl sdfjlk jdfslk djsfl dfjslk jsdflk jfdslk jdfslkds fjlkds
53-
| |jldkfj ldfsjlsd jldsf jlkjds flds fjlk jdflk jdsflj dslfjs dlfj sdflkj sdlfj
54-
| |dfslkjds flkdjsfl sdfjlk jdfslk djsfl dfjslk jsdflk jfdslk jdfslkds fjlkds
55-
| |jldkfj ldfsjlsd jldsf jlkjds flds fjlk jdflk jdsflj dslfjs dlfj sdflkj sdlfj |
56-
| |ldfsj dlfsj dfskjdfs ldsfj
46+
::
47+
48+
Feature| Description |
49+
Ease of use | Drop dead simple!
50+
Foo | Bar, qux, mux
51+
Predictability | Deploykdj sfkljsdjf ljdflsk jsdflkj dsflkj sdlkj dfslkj
52+
| | dfslkjds flkdjsfl sdfjlk jdfslk djsfl dfjslk jsdflk jfdslk jdfslkds fjlkds
53+
| | jldkfj ldfsjlsd jldsf jlkjds flds fjlk jdflk jdsflj dslfjs dlfj sdflkj sdlfj
54+
| |dfslkjds flkdjsfl sdfjlk jdfslk djsfl dfjslk jsdflk jfdslk jdfslkds fjlkds
55+
| |jldkfj ldfsjlsd jldsf jlkjds flds fjlk jdflk jdsflj dslfjs dlfj sdflkj sdlfj
56+
| |dfslkjds flkdjsfl sdfjlk jdfslk djsfl dfjslk jsdflk jfdslk jdfslkds fjlkds
57+
| |jldkfj ldfsjlsd jldsf jlkjds flds fjlk jdflk jdsflj dslfjs dlfj sdflkj sdlfj |
58+
| |ldfsj dlfsj dfskjdfs ldsfj
5759

5860
And some para-text below it.

0 commit comments

Comments
 (0)