documentation-style-guide-sphinx icon indicating copy to clipboard operation
documentation-style-guide-sphinx copied to clipboard

A command to "beautify" RST files

Open benoitbryon opened this issue 13 years ago • 2 comments

Proof of concept implementation could be:

Feature: script which applies style guide recommendations on existing RST files
  In order to apply style guide conventions on existing RST files
  As a documentation writer
  I want to run a script which does most of the work automatically

  Scenario: apply style guide recommendations on an existing RST file
    Given a file named `example.txt`
    And this file contains valid RST content
    And the title of the document doesn't use `#` (sharp) character with overline
    And other titles don't use `#` (sharp) character
    When I run some `rst-beautify` script with `example.txt` as argument
    Then the file is modified in place and the title of the document uses  `#` (sharp) character with overline.

benoitbryon avatar May 07 '12 09:05 benoitbryon

Implementation may be a RST docutils writer: takes a docutils tree and renders it as "standardized" RST.

I don't know if there are RST constructs that we can't reproduce:

  • it seems that docutils tree doesn't embed original sourcecode. We can't simply "go back to original RST".
  • so maybe there are tree elements that could be implemented with several RST structures (i.e. ambiguity).

But, let's give it a try...

benoitbryon avatar Jun 07 '12 11:06 benoitbryon

Started implementation at https://github.com/benoitbryon/rst2rst

benoitbryon avatar Jun 14 '12 07:06 benoitbryon