Skip to content

Commit

Permalink
Add reStructed Text (ReST) support (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankddev authored Feb 20, 2025
1 parent a6a60fb commit 2e7858f
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gengo/languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1033,3 +1033,10 @@ fish: # NOTE: fish is always lowercase in their documentation
- fish
interpreters:
- fish
reStructured Text:
category: prose
color: "#141414"
matchers:
extensions:
- rest
- rst
119 changes: 119 additions & 0 deletions samples-test/samples/reStructured Text/example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
===============================
reStructuredText Syntax Guide
===============================

Basic Formatting
---------------
*italic text*
**bold text**
``inline code``

Headers
-------
Level 1
=======

Level 2
-------

Level 3
~~~~~~~

Lists
-----
* Bullet point
* Another point
* Subpoint
* Another subpoint

1. Numbered list
2. Second item
#. Auto-numbered item

Links
-----
`Link text <https://example.com>`_
External link_
.. _link: https://example.com

Code Blocks
----------
.. code-block:: python
def hello():
print("Hello World")
Tables
------
+------------+------------+
| Header 1 | Header 2 |
+============+============+
| Cell 1 | Cell 2 |
+------------+------------+

Simple Table:
=========== ===========
Header 1 Header 2
=========== ===========
Row 1 Value
Row 2 Value
=========== ===========

Images
------
.. image:: path/to/image.jpg
:width: 100
:alt: Alt text

Notes & Warnings
---------------
.. note::
This is a note

.. warning::
This is a warning

Directives
----------
.. contents:: Table of Contents
:depth: 2

.. sidebar:: Sidebar Title
:subtitle: Optional subtitle

Sidebar content

.. topic:: Topic Title

Topic content

Cross-References
---------------
.. _my-reference-label:

Section Title
------------
Reference to :ref:`my-reference-label`

Footnotes
---------
A footnote reference [1]_

.. [1] This is the footnote content
Comments
--------
.. This is a comment
Line Blocks
----------
| Line blocks preserve
| line breaks and
| leading whitespace
Definition Lists
---------------
term
Definition of the term
another term
Definition of another term

0 comments on commit 2e7858f

Please sign in to comment.