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

Treat feature example sections the same as scenarios #38

Closed rbcasperson closed 4 years ago

rbcasperson commented 4 years ago

If all example sections are at the same level, it can cause an odd case where a feature example comes before any scenario. In that case, all examples tables' section headers will be larger than scenario section headers. So this puts feature examples at the same level as scenarios, which matches the indentation level in the feature file.

Here's that odd case: Screen Shot 2020-05-18 at 4 21 33 PM

^ Notice that Examples is larger than Scenario Outline and Scenario. This all has to do with rST caring only about the order of section underlines rather than what they are. Since we treat all examples tables the same, and examples comes first in this case, it thinks Examples are a higher level.

The reality is that feature examples tables are one level below the feature, the same as all scenarios and scenario outlines. This PR changes the logic to do just that. Here is what it looks like fixed: Screen Shot 2020-05-18 at 4 24 34 PM

^ Background, Feature Examples, and Scenarios are all on the same level (same size), and scenario examples are a subsection of scenarios.

dgou commented 4 years ago

Ran this PR against my work repo, no changes there, so one question (per above) and I can sign off.