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

Enhancement: Step link logic #31

Closed bradsbrown closed 4 years ago

bradsbrown commented 4 years ago

Add a plugin endpoint to support adding a link to step text.

Note that I am proposing moving the url plugin for tag url parsing over to tag_url, BUT keeping nonbreaking legacy support for the url key.

bradsbrown commented 4 years ago

Note that this has been tested green against a large private Gherkin repo within my work suite.

dgou commented 4 years ago

Scanning over the code, it all looks very straight forward. I am curious about including the step keyword though...

Given a step is used here
Given some step comes first
And a step is used here

It seems, having not pulled the code yet, that the step URL maker would see those differently?

bbrownjc commented 4 years ago

That’s the reason for using .step_type.capitalize() rather than .keywordkeyword can be And if that’s the literal value in the Gherkin, but step_type will always reliably be in [“given”, “when”, “then”]

dgou commented 4 years ago

Also thinking out loud, it seems as if there wouldn't be much cause for confusion re: some string being a step or some string being a URL, so one "turn things into links" function..... It's a slipper slope, I have wanted something like this for a while, but not a strong want... More in terms of linking things from example tables than actual steps. So maybe have speciality linking functions would be more handy...

The code is quite clean, but before I sign off I do want to pull it and run against my work code base too. Hopefully tomorrow, if not, over the weekend.

bradsbrown commented 4 years ago

Travis passes, but isn't closing the "hook" back to GH for some reason. Merging with 3 approvals and passing CI