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

White spaces removed in description with --raw-description #60

Open erichstuder opened 1 week ago

erichstuder commented 1 week ago

I have a feature file like this where i'd like to place a sphinx-needs requirement in the feature description.

# language: en
Feature: Start Simulator

    .. req:: Start Simulator
        :links: UC_001, UC_002, UC_005, UC_006

    Scenario: Start the simulator and begin animation
        When I start the simulator
        Then the led animation starts rightaway

When i create the rst-file with option --raw-descriptions i get the following result. As you can see the line :links: UC_001, UC_002, UC_005, UC_006 is left aligned which isn't correctly recognized by sphinx-needs. I think the problem is the behave parser, but I couldn't pin the exact location. Is there a possibility to prevent the removal of leading white spaces when using --raw-descriptions? Is this a possible improvement for future releases?

.. role:: gherkin-step-keyword
.. role:: gherkin-step-content
.. role:: gherkin-feature-description
.. role:: gherkin-scenario-description
.. role:: gherkin-feature-keyword
.. role:: gherkin-feature-content
.. role:: gherkin-background-keyword
.. role:: gherkin-background-content
.. role:: gherkin-scenario-keyword
.. role:: gherkin-scenario-content
.. role:: gherkin-scenario-outline-keyword
.. role:: gherkin-scenario-outline-content
.. role:: gherkin-examples-keyword
.. role:: gherkin-examples-content
.. role:: gherkin-tag-keyword
.. role:: gherkin-tag-content

:gherkin-feature-keyword:`Feature:` :gherkin-feature-content:`Start Simulator`
==============================================================================

.. req:: Start Simulator
:links: UC_001, UC_002, UC_005, UC_006

:gherkin-scenario-keyword:`Scenario:` :gherkin-scenario-content:`Start the simulator and begin animation`
---------------------------------------------------------------------------------------------------------

| :gherkin-step-keyword:`When` I start the simulator
| :gherkin-step-keyword:`Then` the led animation starts rightaway