Skip to content

Commit 35e758b

Browse files
authored
Documentation guidelines updates (#2075)
* fixes gh-1881 document extsamp role * fixes gh-1836 add note about specifying link names
1 parent 8b591ba commit 35e758b

File tree

6 files changed

+65
-32
lines changed

6 files changed

+65
-32
lines changed
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
2-
* :doc:`/reference/reference_lua/box_index`
3-
* :doc:`/reference/reference_lua/box_error`
4-
* :doc:`/reference/reference_lua/box_backup`
1+
:doc:`/reference/reference_lua/box_index`
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Check out the :ref:`Quick start guide <vshard-quick-start>`.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
:samp:`{space_object}:insert`:code:`({ffi.cast('double',`:samp:`{value}`:code:`)})`
1+
:samp:`{space_object}:insert(\\{ffi.cast('double', {value})\\})`
2+
3+
:extsamp:`{*{space_object}*}:insert({ffi.cast('double', {**{value}**})})`

doc/contributing/docs/markup/code.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ Notes on using inline-code
114114
Highlighting variables in code
115115
------------------------------
116116

117-
If you need to mark up a placeholder inside code inline, use the ``:samp:``
118-
role, like this:
117+
If you need to mark up a placeholder inside code inline, use the ``:samp:`` or
118+
our custom ``:extsamp:`` role, like this:
119119

120120
.. literalinclude:: _includes/samp.rst
121121
:language: rst
@@ -124,6 +124,17 @@ And you will get this:
124124

125125
.. include:: _includes/samp.rst
126126

127+
Notice two backslashes before the curly brackets in the first line.
128+
They are needed to escape curly brackets from Lua syntax.
129+
130+
As you can see, ``:extsamp:`` extends the abilities of ``:samp:``.
131+
It allows you to highlight placeholders in both italics and bold
132+
and avoid escaping curly brackets.
133+
``:extsamp:`` has the following syntax:
134+
135+
* ``{*{element}*}`` for *italic*
136+
* ``{**{element}**}`` for **bold**
137+
127138
If you need to mark up a placeholder in code block, use
128139
the following syntax:
129140

doc/contributing/docs/markup/links.rst

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Linking to other documentation pages
77
To create a link to another document in our documentation, we use the ``:doc:`` role.
88
For example, this link points to the document ``/reference/reference_lua/box_error.rst``:
99

10-
.. code-block:: rst
10+
.. code-block:: rst
1111
12-
:doc:`box.error reference </reference/reference_lua/box_error>`
12+
:doc:`box.error reference </reference/reference_lua/box_error>`
1313
1414
Our convention is to put the full path to the referred document so that we can
1515
easily replace the path if it changes.
@@ -18,12 +18,12 @@ Note that we can omit the ``.rst`` part of the filename.
1818
You can use the target document's title as the link text.
1919
To do so, omit the text in the link definition:
2020

21-
.. literalinclude:: _includes/doc-link.rst
22-
:language: rst
21+
.. literalinclude:: _includes/doc-link.rst
22+
:language: rst
2323

2424
And you will get this:
2525

26-
.. include:: _includes/doc-link.rst
26+
.. include:: _includes/doc-link.rst
2727

2828
Linking to labels (anchors)
2929
---------------------------
@@ -56,24 +56,33 @@ The tag can be anything meaningful. The only guideline is for Tarantool syntax
5656
items (such as members), where the preferred tag syntax is
5757
``module_or_object_name dash member_name``. For example, ``box_space-drop``.
5858

59+
To add a link to an anchor, use the following syntax:
60+
61+
.. literalinclude:: _includes/ref-link.rst
62+
:language: rst
63+
64+
The result will be like this:
65+
66+
.. include:: _includes/ref-link.rst
67+
5968
Linking to external resources
6069
-----------------------------
6170

6271
To make an external link, use the following syntax:
6372

64-
.. code-block:: text
73+
.. code-block:: text
6574
66-
This is a paragraph that contains `a link <http://example.com/>`_.
75+
Feel free to report an issue at `Tarantool GitHub <https://github.com/tarantool/tarantool/issues>`_.
6776
6877
Avoid separating the link and the target definition, like this:
6978

70-
.. container:: dont
79+
.. container:: dont
7180

72-
.. code-block:: rst
81+
.. code-block:: rst
7382
74-
This is wrong way to make `a link`_.
83+
Feel free to report an issue at `Tarantool GitHub`_.
7584
76-
.. _a link: http://example.com/
85+
.. _Tarantool GitHub: https://github.com/tarantool/tarantool/issues
7786
78-
**Warning:** Every separated link tends to cause troubles when this documentation
79-
is translated to other languages. Please avoid using separated links.
87+
because every separated link tends to cause troubles when this documentation
88+
is translated to other languages.

doc/contributing/docs/style.rst

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11

2-
================================================================================
32
Language and style
4-
================================================================================
3+
==================
54

6-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75
US vs British spelling
8-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6+
----------------------
97

108
We use English US spelling.
119

12-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1310
Instance vs server
14-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11+
------------------
1512

1613
We say "instance" rather than "server" to refer to an instance of Tarantool
1714
server. This keeps the manual terminology consistent with names like
@@ -23,10 +20,8 @@ of the same databases."
2320
Correct usage: "Replication allows multiple Tarantool *instances* to work on
2421
copies of the same databases."
2522

26-
27-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2823
Express one idea in a sentence
29-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24+
------------------------------
3025

3126
Say exactly one thing in a sentence.
3227
If you want to define or clarify something, do it in a separate sentence.
@@ -61,9 +56,8 @@ Simple sentences are easier to read, understand and translate.
6156
- A replica set from which the bucket is being migrated is called a source.
6257
A target replica set to which the bucket is being migrated is called a destination.
6358

64-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6559
Don't use i.e. and e.g.
66-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60+
-----------------------
6761

6862
Don't use the following contractions:
6963

@@ -76,4 +70,23 @@ Many people, especially non-native English speakers,
7670
aren't familiar or don't know the difference between
7771
`"i.e." and "e.g." contractions
7872
<https://www.merriam-webster.com/words-at-play/ie-vs-eg-abbreviation-meaning-usage-difference>`_.
79-
So it's best to avoid using them.
73+
So it's best to avoid using them.
74+
75+
Specify a link text
76+
-------------------
77+
78+
While giving a :doc:`link </contributing/docs/markup/links>`, specify clearly
79+
where this link leads. Thus, you will not mislead a reader.
80+
81+
Bad example:
82+
83+
For more details, click :doc:`here </contributing/docs/markup/links>`.
84+
85+
Use :doc:`this </contributing/docs/markup/links>`.
86+
87+
Good example:
88+
89+
For more details, refer to the documentation on
90+
:doc:`making links </contributing/docs/markup/links>`.
91+
92+
Use full :doc:`link names </contributing/docs/markup/links>`.

0 commit comments

Comments
 (0)