You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add needed import statement to needs_extra_options #67
Maybe this kind of detailed definition is even not really needed.
I see no use case, where an additional option should be something different as directive.unchanged.
I guess that also our code would have some problem with any other kind of directive type...
So needs_extra_options could be a simple list and sphinx-needs sets the needed directive type internally: needs_extra_options = ["author", "creation_date"]
This model is rather restrictive though. For instance, if I want to introduce a piece of metadata and make it required, then I can't do that. Likewise if I want to introduce an attribute that is a flag. This seems like an important hook point for validation and error checking. The full set of built-in options conversion functions are here: http://docutils.sourceforge.net/docs/howto/rst-directives.html#option-conversion-functions however at they simple functions and there's no need to use those vs. your own.
Improving the docs makes sense, but I wouldn't be in favor of removing the capability. Perhaps, if you want to make it easier, then we could change the default behavior to if you specify None then we default to unchanged. That avoids requiring an import, but leaves the option for customization if needed.
No problem to keep it as it is, if there are cases for different options conversion functions.
However I'm not sure if sphinx-needs can already handle it.
For instance if positive_int_list shall be used, sphinx-needs may crash as it expects a string and not a list. Maybe the same for a flag (But I haven't check the code right now).
Activity
danwos commentedon Jul 25, 2018
Maybe this kind of detailed definition is even not really needed.
I see no use case, where an additional option should be something different as
directive.unchanged.I guess that also our code would have some problem with any other kind of directive type...
So
needs_extra_optionscould be a simple list and sphinx-needs sets the needed directive type internally:needs_extra_options = ["author", "creation_date"]tlovett commentedon Jul 25, 2018
This model is rather restrictive though. For instance, if I want to introduce a piece of metadata and make it required, then I can't do that. Likewise if I want to introduce an attribute that is a flag. This seems like an important hook point for validation and error checking. The full set of built-in options conversion functions are here: http://docutils.sourceforge.net/docs/howto/rst-directives.html#option-conversion-functions however at they simple functions and there's no need to use those vs. your own.
Improving the docs makes sense, but I wouldn't be in favor of removing the capability. Perhaps, if you want to make it easier, then we could change the default behavior to if you specify None then we default to unchanged. That avoids requiring an import, but leaves the option for customization if needed.
Thoughts?
danwos commentedon Jul 25, 2018
No problem to keep it as it is, if there are cases for different options conversion functions.
However I'm not sure if sphinx-needs can already handle it.
For instance if
positive_int_listshall be used, sphinx-needs may crash as it expects a string and not a list. Maybe the same for a flag (But I haven't check the code right now).So let's just do the doc update....
danwos commentedon Sep 28, 2018
Fixed in 0.3.0
🔧 Import sphinx-codelinks into the workspace as packages/sphinx-codel…