Skip to content

Commit

Permalink
Merge pull request #1000 from sphinx-contrib/expand-strike-doc-content
Browse files Browse the repository at this point in the history
doc: add a strike-specific guide
  • Loading branch information
jdknight committed Jun 28, 2024
2 parents 092b99f + f46caa5 commit b27c90c
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 40 deletions.
41 changes: 1 addition & 40 deletions doc/guide-class-hints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,43 +38,4 @@ See also :ref:`confluence_code_block_theme <confluence_code_block_theme>`.
``strike``
----------

.. versionadded:: 1.7

When this class hint is applied to inlined text, the text will be styled
with a strikethrough style. Sphinx projects may define the following in
a document to support the strikethrough of text in both the ``html`` and
``confluence`` builders (assuming the HTML documents are also prepared to
support the ``strike`` class):

.. code-block:: none
.. role:: strike
:class: strike
This is an :strike:`example`.
Projects may also move the role definition inside the project's ``conf.py``
inside `rst_prolog <rst_prolog_>`_ as follows:

.. code-block:: python
rst_prolog = """
.. role:: strike
:class: strike
"""
Projects using `Markedly Structured Text - Parser <myst-parser_>`_ can also
take advantage of the role defined in ``rst_prolog`` (above) and use the
role as follows:

.. code-block:: md
This is an {strike}`example`.
.. references ------------------------------------------------------------------
.. _myst-parser: https://myst-parser.readthedocs.io/
.. _rst_prolog: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-rst_prolog
See :ref:`Strike content <confluence_strike_ch>` for more details.
81 changes: 81 additions & 0 deletions doc/guide-strike.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
.. index:: Strike

Strike content
==============

There are a series of strike element capabilities supported by the
Confluence builder extension. This guide will cover the available options
that can be used.

Strike role
-----------

.. versionadded:: 2.1

This extension provides a ``confluence_strike`` role to help strike
content. For example:

.. code-block:: rst
:confluence_strike:`My text`
This role will only work when using the Confluence builder. See also the
:ref:`Confluence Strikethrough role <confluence_strike-role>`.

.. _confluence_strike_ch:

Class hints
-----------

.. versionadded:: 1.7

When this class hint is applied to inlined text, the text will be styled
with a strikethrough style. Sphinx projects may define the following in
a document to support the strikethrough of text in both the ``html`` and
``confluence`` builders (assuming HTML documents are also prepared to
support the ``strike`` class):

.. code-block:: none
.. role:: strike
:class: strike
This is an :strike:`example`.
Projects may also move the role definition inside the project's ``conf.py``
inside `rst_prolog <rst_prolog_>`_ as follows:

.. code-block:: python
rst_prolog = """
.. role:: strike
:class: strike
"""
Projects using `Markedly Structured Text - Parser <myst-parser_>`_ can also
take advantage of the role defined in ``rst_prolog`` (above) and use the
role as follows:

.. code-block:: md
This is an {strike}`example`.
sphinxnotes-strike's strike role
--------------------------------

.. versionadded:: 2.2

When using the `sphinxnotes-strike`_ extension, a ``strike`` role should
be able to manage striked content. For example:

.. code-block:: rst
:strike:`My text`
.. references ------------------------------------------------------------------
.. _myst-parser: https://myst-parser.readthedocs.io/
.. _rst_prolog: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-rst_prolog
.. _sphinxnotes-strike: https://sphinx.silverrainz.me/strike/
1 change: 1 addition & 0 deletions doc/guides.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ the Confluence Builder extension in a Sphinx-enabled environment.
guide-collapse
guide-confluence-macros
guide-math
guide-strike
guide-ci
2 changes: 2 additions & 0 deletions doc/roles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ generated Confluence documents.
:confluence_status:`PASSED [green]`
.. index:: Strikethrough (role)
.. _confluence_strike-role:

Strikethrough
-------------
Expand All @@ -217,6 +218,7 @@ generated Confluence documents.
:confluence_strike:`My text`
See also :doc:`guide-strike`.

.. references ------------------------------------------------------------------
Expand Down

0 comments on commit b27c90c

Please sign in to comment.