plugin reStructuredText Helper

Plugins for SynWrite and CudaText...
Post Reply
lookoutside
Posts: 51
Joined: 17.08.2022 13:42

plugin reStructuredText Helper

Post by lookoutside »

Dear author, thanks for your help in the preceding posts. I have a suggestion for rst editing plugin. Perhaps this is the last one, because it seems that all the other difficulties are solved.

The rst (restructuredtext) writers need to write heads frequently like this:

Code: Select all

Chapter 1 Title
===============

Section 1.1 Title
-----------------

Subsection 1.1.1 Title
~~~~~~~~~~~~~~~~~~~~~~

Section 1.2 Title
-----------------

Chapter 2 Title
===============

In the above source code, symbols like "=", "-", "~" under the head name are markers indicating the section level. Perhaps it's acceptable to write the markers by hand. But changing the level is very inefficient and tiresome:
  • 1. delete the line of markers by pressing del key many times
  • 2. insert a line of new markers, which is the same length as the head name
Markdown writers have the similar problem except that they use different markers. In fact, changing level can be done with a shortcut in many weight software. I think macros or plugin in cudatext can do this:
  • 1. When a shortcut (for example: Ctrl + 1 ) is pressed, the current line are marked with a specific head level (inserting a line consisting of "="s) .
  • 2. If there are markers for the current line already, the old markers are deleted before the new ones being inserted.
  • 3. The new inserted markers should be the same length with the head name.
By duplicating the above macro, users can define: Ctrl + 2 inserting a line of "-" for level 2, etc.

Perhaps macros cann't do this and some python codes are needed.
Last edited by lookoutside on 25.08.2022 01:36, edited 1 time in total.
main Alexey
Posts: 2323
Joined: 25.08.2021 18:15

Post by main Alexey »

Okay suggestion. macro is very hard to do here. I will make simple plugin. expect it soon...
main Alexey
Posts: 2323
Joined: 25.08.2021 18:15

Post by main Alexey »

new plugin is published. 'reStructuredText Helper'.
It gives 4 commands and has config-file (see readme.txt) to set N header levels. seems 4 levels are enough?
lookoutside
Posts: 51
Joined: 17.08.2022 13:42

Post by lookoutside »

Sorry for delaying the response.

I modify some of the plugin code to get 6 levels. It seems too many, but adequate. Because I need not to remember what's the head marks now.

Perhaps you can change it, too.
main Alexey
Posts: 2323
Joined: 25.08.2021 18:15

Post by main Alexey »

added commands for level 5 and 6. added the "config" command. plugin updated in addons.
Post Reply