Skip to content

Go script to adjust lengths of title underlines in reStructuredText files

Notifications You must be signed in to change notification settings

JeffSchering/rst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rst

Go script to adjust lengths of title underlines in reStructuredText files

This script walks a directory tree, reads in each .rst file that it finds, and adjusts the title underline lengths if needed. It writes the changes back to the original files.

For example, this:

======
Administrator Tasks
======

becomes this:

===================
Administrator Tasks
===================

Similarly, this:

Administrator Tasks
--------

becomes this:

Administrator Tasks
-------------------

Lines that are longer than the title are not affected.

I did this on a Windows machine, so the line endings in the changed .rst files might be off.

Usage

To run the tests, cd to your Go directory and type the following command:

go test github.com/JeffSchering/rst

To install the script, cd to your Go directory and type the following command:

go install github.com/JeffSchering/rst

To run the script after installing, go to your Go bin directory and type the following command:

rst.exe <filepath>

where <filepath> is the top level directory that contains your .rst files.

About

Go script to adjust lengths of title underlines in reStructuredText files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages