jolly-good-toolbelt / sphinx_gherkindoc

A tool to convert Gherkin into Sphinx documentation
https://jolly-good-toolbelt.github.io/sphinx_gherkindoc/
11 stars 10 forks source link

Feature and scenario descriptions ignore newlines #28

Closed rbcasperson closed 4 years ago

rbcasperson commented 4 years ago

If I write out my feature or scenario description nicely like this:

Feature: Example

  Given this list of things:
  - A
  - B
  - C

  Header 1: Value 1
  Header 2: Value 2

  Scenario: Example
          North

    West         East

          South

    Given a thing
    When nothing
    Then who cares?

It get smushed all together like this:

Screen Shot 2020-02-14 at 5 18 25 PM

This can make things look really horrible when the descriptions are there to make things easier to read and understand. We need to find a way to preserve line breaks in descriptions.

A bit of investigation shows that it is behave's parser that gets rid of line breaks. So we may need to jump around that somehow (read that bit from the actual file so it can be treated as pure rst).

cdemattio-jc commented 4 years ago

If at all possible, I would like to see the free-form descriptions (both at the feature level and at the scenario level) handled as pure reST. We'll want to include figures, hyperlinks, etc.

dgou commented 4 years ago

IIRC the original design prevented that in case the writers of the gherkin didn't understand they were writing rST, but I defer to @brolewis for his better memory.

In any event, without more precise control over the spacing/newlines, rST won't be possible... :-(

cdemattio-jc commented 4 years ago

The nice thing about rST is that it's generally backwards compatible with plain text so non-rST literate folks shouldn't have too many issues. I think the biggest issue is probably the way that rST handles/requires whitespace.

Having said that, I can see the concern about not foisting rST on everyone. Should we make it a configurable option?

rbcasperson commented 4 years ago

This is now supported!