plugin reStructuredText Helper
Posted: 24.08.2022 10:00
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:
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:
Perhaps macros cann't do this and some python codes are needed.
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
===============
- 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
- 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.
Perhaps macros cann't do this and some python codes are needed.