|
2 | 2 | Usage |
3 | 3 | ===== |
4 | 4 |
|
5 | | -The ``isso`` directive is used to insert a Isso comment box. |
6 | | -Each comment thread is distinguished by Isso Thread ID (``data-isso-id``), |
7 | | -which can be specified via the ``id`` option (see below) or via ``:isso-id`` |
8 | | -docinfo. If no thread ID given, ``/{docname}`` will be used. |
| 5 | +.. note:: |
9 | 6 |
|
10 | | -The directive supports the following options: |
| 7 | + Isso only supports rendering **one comment thread on the same page**. |
| 8 | + If you insert multiple comment threads on the same page, the extra threads |
| 9 | + will display error messages. |
11 | 10 |
|
12 | | -:id: (text) |
13 | | - Specify a thread ID, optional |
14 | | -:title: (text) |
15 | | - Specify a thread title rather than use document title |
| 11 | +There are two ways to insert comment thread: |
16 | 12 |
|
17 | | -Enable comments for all documents |
18 | | -================================= |
| 13 | +Manual insert (at a specific location) |
| 14 | +-------------------------------------- |
19 | 15 |
|
20 | | -Use Sphinx's ``rst_epilog`` confval to append the ``isso`` directive at the |
21 | | -end of every source file. For example: |
| 16 | +.. rst:directive:: .. isso:: [id] |
22 | 17 |
|
23 | | -.. code:: python |
| 18 | + Insert a Isso comment thread at a specific location. |
24 | 19 |
|
25 | | - rst_epilog = """ |
26 | | - .. isso:: |
27 | | - """ |
| 20 | + Threads are distinguished by unique Isso Thread ID (``data-isso-id``), |
| 21 | + If no thread ID given, ``/{docname}`` (a slash-prefixed document name) |
| 22 | + will be used. |
28 | 23 |
|
29 | | -Disable comments for specified document |
30 | | ---------------------------------------- |
| 24 | + .. rst:directive:option:: title: title |
| 25 | + :type: text |
31 | 26 |
|
32 | | -This extension respects the ``:nocomments`` docinfo__: |
| 27 | + Indicate thread title rather than use original document title. |
33 | 28 |
|
34 | | - If set, the web application won’t display a comment form for a page generated |
35 | | - from this source file. |
| 29 | +Batch insert (at the end of the document) |
| 30 | +----------------------------------------- |
36 | 31 |
|
37 | | -__ https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html#file-wide-metadata |
| 32 | +If document's docname is matched by :confval:`isso_include_patterns` and |
| 33 | +not matched by :confval:`isso_exclude_patterns`, a comment thread will be |
| 34 | +automaticlly inserted at the end. |
| 35 | + |
| 36 | +For example: |
| 37 | + |
| 38 | +.. code-block:: python |
| 39 | + :caption: Enable commenting for all documents |
| 40 | +
|
| 41 | + isso_include_patterns = ['**'] |
| 42 | + isso_exclude_patterns = [] |
| 43 | +
|
| 44 | +.. code-block:: python |
| 45 | + :caption: Enable commenting for only blog posts |
| 46 | +
|
| 47 | + isso_include_patterns = ['blog/**'] |
| 48 | +
|
| 49 | +.. code-block:: python |
| 50 | + :caption: Enable commenting for all documents (except blog posts) |
| 51 | +
|
| 52 | + isso_include_patterns = ['**'] |
| 53 | + isso_exclude_patterns = ['blog/**'] |
| 54 | +
|
| 55 | +DocInfos |
| 56 | +~~~~~~~~ |
| 57 | +
|
| 58 | +Users can configure the batched inserted comment thread by setting docinfo_: |
| 59 | +
|
| 60 | +:``:isso-id``: |
| 61 | + Indicate the Isso thread ID, similar to :rst:dir:`isso` directive's argument. |
| 62 | +
|
| 63 | +:``:nocomments``: |
| 64 | + This extension respects the standard ``:nocomments`` docinfo: |
| 65 | +
|
| 66 | + If set, the web application won’t display a comment form for a page generated |
| 67 | + from this source file. |
| 68 | +
|
| 69 | +.. _docinfo: https://www.sphinx-doc.org/en/master/usage/restructuredtext/field-lists.html#file-wide-metadata |
0 commit comments