Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
45486015
Commit
45486015
authored
8 years ago
by
lenkis
Browse files
Options
Downloads
Patches
Plain Diff
Adding ReST source for the alpha-version of doc guidelines
parent
25042d9c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/sphinx/dev_guide/documentation_guidelines.rst
+137
-0
137 additions, 0 deletions
doc/sphinx/dev_guide/documentation_guidelines.rst
with
137 additions
and
0 deletions
doc/sphinx/dev_guide/documentation_guidelines.rst
0 → 100644
+
137
−
0
View file @
45486015
-------------------------------------------------------------------------------
Documentation guidelines
-------------------------------------------------------------------------------
These guidelines are updated on the on-demand basis, covering only those issues
that cause pains to the existing writers. At this point, we do not aim to come
up with an exhaustive Documentation Style Guide for the Tarantool project.
===========================================================
Markup issues
===========================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wrapping text
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The limit is 80 characters per line for plain text, and no limit for any other
constructions when wrapping affects ReST readability and/or HTML output. Also,
it makes no sense to wrap text into lines shorter than 80 characters unless you
have a good reason to do so.
The 80-character limit comes from the ISO/ANSI 80x24 screen resolution, and it's
unlikely that readers/writers will use 80-character consoles. Yet it's still a
standard for many coding guidelines (including Tarantool). As for writers, the
benefit is that an 80-character page guide allows keeping the text window rather
narrow most of the time, leaving more space for other applications in a
wide-screen environment.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Making comments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sometimes we may need to leave comments in a ReST file. To make sphinx ignore
some text during processing, use the following per-line notation with ".. //" as
the comment marker:
.. // your comment here
`The notation example is excluded from HTML output, so please see the source in
ReST.`
The starting symbols ".. //" do not interfere with the other ReST markup, and
they are easy to find both visually and using grep. There are no symbols to
escape in grep search, just go ahead with something like this:
.. code-block:: console
grep ".. //" doc/sphinx/dev_guide/*.rst
These comments don't work properly in nested documentation, though (e.g. if you
leave a comment in module -> object -> method, sphinx ignores the comment and
all nested content that follows in the method description).
===========================================================
Language and style issues
===========================================================
*TBD (to be discussed)*
===========================================================
Examples and templates
===========================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module and function
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is an example of documenting a module (``my_fiber``) and a function
(``my_fiber.create``).
.. module:: my_fiber
.. function:: create(function [, function-arguments])
Create and start a ``my_fiber`` object. The object is created and begins to
run immediately.
:param function: the function to be associated with the ``my_fiber`` object
:param function-arguments: what will be passed to function
:return: created ``my_fiber`` object
:rtype: userdata
**Example:**
.. code-block:: tarantoolsession
tarantool> my_fiber = require('my_fiber')
---
...
tarantool> function function_name()
> my_fiber.sleep(1000)
> end
---
...
tarantool> my_fiber_object = my_fiber.create(function_name)
---
...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module, class and method
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is an example of documenting a module (``my_box.index``), a class
(``my_index_object``) and a function (``my_index_object.rename``).
.. module:: my_box.index
.. class:: my_index_object
.. method:: rename(index-name)
Rename an index.
*Here follow 2 different notations for the same set of parameters.*
:param index_object: an object reference
:param index_name: a new name for the index (type = string)
Parameters:
* :samp:`{index_object}` = an object reference;
* :samp:`{index-name}` (type = string) = new name for index.
:return: nil
Possible errors: index_object does not exist.
**Example:**
.. code-block:: tarantoolsession
tarantool> box.space.space55.index.primary:rename('secondary')
---
...
Complexity Factors: Index size, Index type, Number of tuples accessed.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment