Difference between revisions of "Contribute to Documentation with reStructuredText"

From Inkscape Wiki
Jump to navigation Jump to search
(Add media)
Line 11: Line 11:


[https://vscodium.com VSCodium] (same like Visual Studio Code, but fully Open Source!)
[https://vscodium.com VSCodium] (same like Visual Studio Code, but fully Open Source!)
[[File:Esbonio.png|alt=The Esbonio extension on the VSCode marketplace|thumb|The Esbonio extension on the VSCode marketplace]]


=== Install Esbonia Extension ===
=== Install Esbonia Extension ===
This extension is required to render <code>*.rst</code> files. Rendering helps to validate, that the code we wrote is valid before we commit and push to Inkscape repositories. It can show a live HTML preview of the documentation, so the preview contents change whenever the document is updated. Syncronised scrolling between the source and preview is also supported.
This extension is required to render <code>*.rst</code> files. Rendering helps to validate, that the code we wrote is valid before we commit and push to Inkscape repositories. It can show a live HTML preview of the documentation, so the preview contents change whenever the document is updated. Syncronised scrolling between the source and preview is also supported.


Download/Install: [https://marketplace.visualstudio.com/items?itemName=swyddfa.esbonio](https://marketplace.visualstudio.com/items?itemName=swyddfa.esbonio
Download/Install: https://marketplace.visualstudio.com/items?itemName=swyddfa.esbonio


=== Install additional requirements ===
=== Install additional requirements ===
Line 22: Line 23:
After this, we have following commands available for CLI also:
After this, we have following commands available for CLI also:
  sphinx-apidoc sphinx-autogen sphinx-build sphinx-quickstart
  sphinx-apidoc sphinx-autogen sphinx-build sphinx-quickstart
<p class="callout info">See also [https://www.sphinx-doc.org/en/master/usage/installation.html](https://www.sphinx-doc.org/en/master/usage/installation.html)</p>
<p class="callout info">''See also https://www.sphinx-doc.org/en/master/usage/installation.html''</p>


=== Clone the documentation ===
=== Clone the documentation ===
Line 29: Line 30:


=== Open the folder within VSCodium and begin to contribute ===
=== Open the folder within VSCodium and begin to contribute ===
[[File:Rst-vscodium.png|left|frame|Live preview of rST files in VSCodium]]


=== Troubleshooting ===
=== Troubleshooting ===

Revision as of 09:00, 27 May 2025

To contribute to recent Inkscape documentations, we have to write our docs in reStructuredText file format (*.rst). It's similar to Markdown, but still different.

The Inkscape documentation is built up on Sphinx, which is some kind of special engine. To easily contribute without being a professional developer, we can use VSCodium and some plugin to edit those *.rst files and preview (render) them.

Install VS Code or VSCodium

With VSCodium we can edit *.rst files with ease. There's native syntax highlighting. But we cannot render the final result by default (needs a separate extension).

Downloads:

Visual Studio Code

VSCodium (same like Visual Studio Code, but fully Open Source!)

The Esbonio extension on the VSCode marketplace
The Esbonio extension on the VSCode marketplace

Install Esbonia Extension

This extension is required to render *.rst files. Rendering helps to validate, that the code we wrote is valid before we commit and push to Inkscape repositories. It can show a live HTML preview of the documentation, so the preview contents change whenever the document is updated. Syncronised scrolling between the source and preview is also supported.

Download/Install: https://marketplace.visualstudio.com/items?itemName=swyddfa.esbonio

Install additional requirements

We install Sphinx globally to system, that's why we use the python3-* packages:

sudo apt install python3-sphinx python3-doc8

After this, we have following commands available for CLI also:

sphinx-apidoc sphinx-autogen sphinx-build sphinx-quickstart

See also https://www.sphinx-doc.org/en/master/usage/installation.html

Clone the documentation

cd ~/
git clone https://gitlab.com/inkscape/extensions.git

Open the folder within VSCodium and begin to contribute

Live preview of rST files in VSCodium

Troubleshooting

My opened *.rst file is not rendered

Opening a single file without an active workspace is not currently supported and will lead to errors, which might not be communicated to the user visually. Open the folder containing your documentation project in VSCode instead!