Msp allow docs name#648
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //src:license-checkStatus: Click to expand output |
| repo = repo.lstrip("@") | ||
|
|
||
| if path_to_target == "" and target in ("needs_json", "docs_sources"): | ||
| # The producer's docs() macro may have used a custom `name`, in which case its targets |
There was a problem hiding this comment.
Probably can make this nicer with saying "docs_sources" in target
|
The created documentation from the pull request is available at: docu-html |
| def add_config_value_if_absent( | ||
| app: Sphinx, name: str, default: Any, rebuild: _ConfigRebuild | ||
| ) -> None: | ||
| """Register a Sphinx config value, unless another extension already has. | ||
|
|
||
| Several of our extensions may be used either standalone or bundled together via | ||
| score_sphinx_bundle, in either load order, and may each want the same config value | ||
| registered. Sphinx raises if `add_config_value` is called twice for the same name, | ||
| so this guards the registration to make it safe to call from multiple extensions. | ||
| """ | ||
| # Sphinx has no public API for this check either; `_options` is the internal dict | ||
| # `Config.add` itself consults to reject duplicate registrations. | ||
| if name not in app.config._options: # pyright: ignore [reportPrivateUsage] | ||
| app.add_config_value(name, default, rebuild=rebuild) |
There was a problem hiding this comment.
is this truly needed?
Not using score_bundle should be not allowed in S-CORE, so I thin kwe can remove this,
MaximilianSoerenPollak
left a comment
There was a problem hiding this comment.
Probably 1 - 2 things still to iron out here, but overall looks like a good approach I think
|
|
||
| By using this function, you'll get any and all updates for documentation targets in one place. | ||
|
|
||
| The macro can be called multiple times in the same BUILD file as long as each call uses a |
There was a problem hiding this comment.
I'm not convinced that this is a good idea.
There can only be exactly one documentation hosted by github.io. What is the motivation to have more?
The need to distribute documentation across the repo is addressed by implemented DR-008-infra.
There was a problem hiding this comment.
Yes there can be only one hosted, that is correct.
This is to allow for multiple docs to be build, without it being hosted.
Basically many independent documentations in one repo and allow / enable them all to be build without them needing to be hosted.
This is also in anticipation of the split up we might need to do in regards to trlc things.
📌 Description
Allow the docs macro to be used with a
nameattribute as is custom for almost all bazel macros.This will allow us in the future to use the docs marco in the same build file multiple times, with different inputs and have no collision.
This should be a good first step towards coming closer to how bazel macros should be written and make it more useable in other settings too.
=> Still a challenge though is how we can enforce non idiotic usage of this in S-CORE.
ℹ️ Still a Draft PR until the Docs are changed and we have agreed internally how this should be done.
🚨 Impact Analysis
✅ Checklist