benoitbryon / documentation-style-guide-sphinx

Coding standards for Sphinx-based documentations
26 stars 19 forks source link

A command to "beautify" RST files #8

Open benoitbryon opened 12 years ago

benoitbryon commented 12 years ago

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 commented 12 years ago

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:

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

benoitbryon commented 12 years ago

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