markvincze / sabledocs

Simple static documentation generator for Protobuf and gRPC contracts.
MIT License
45 stars 12 forks source link

add support for repository-dir in code urls #36

Closed wjackson closed 7 months ago

wjackson commented 7 months ago

Sometimes your proto files are inside a specific directory in your git repo. At least mine are. This PR adds support for the config value repository-dir. That makes links from docs to protos work correctly in this situation.

Note: I used furl in build_source_code_url to try and keep things tidy. That's an extra dependency though. I'd be happy to give you a string-template-style implementation if you like that better. I added some tests for that to hopefully make it clear that my changes there don't break anything.

markvincze commented 7 months ago

@wjackson Good idea, thanks for the submission! I'm okay with keeping furl, I see it's pretty widely used.

Thanks for writing the tests, I was planning to start creating tests at some point, so it's nice that we get started with that now. :) I'll look into including running the tests as part of the CI Build too.

As this is a new feature: could you bump the minor version here to 0.10: https://github.com/markvincze/sabledocs/blob/main/pyproject.toml#L7 ?

wjackson commented 7 months ago

@markvincze I went ahead and updated the minor version number as you suggested.