question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sometimes a useful attribute about a need can be derived rather than explicitly stated in the RST.

In our use case, we have a separate project that implements scripts that validate the requirement against some vendors implementation of the spec. We’d like to keep track of which requirements have validation scripts written, but we’d also prefer not to have to keep track of this information in both the requirements project and the validation project. The validation project already tracks traceability to the requirements in an usable data format such as YAML.

It would be nice if we could add derived metadata to a requirement that a script exists and provide a link to that particular script.

The idea I thought would be useful would be being able to specify dynamic attributes in the conf.py file, and map them to some callable that could derive the value at build time.

Perhaps something like this in conf.py:

# Instantiate some object that can look up the information.
# In a more simple example, it could map to a single function

repos = ValidationRepository('some config to get the data')

needs_dynamic_options = {
   'validated' : repos.is_validated,
   'validation_link': repos.get_link,
}

These callables could be invoked and be passed the app environment and the need_info during the build, and then derive additional attributes. This derivation could make use of external resources or just other attributes in need_info.

Technically a single callable could return a dict that gets merged, but I’m thinking it’s better to be explicit about the values.

The downside here is this attribute only gets created at build time, but at least in our case we could have our CI builds could trigger the documentation build whenever it’s updated.

I could also see a use case for a JavaScript method to get the value, but that would only be available to HTML builders and would probably be more complicated to implement.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
danwoscommented, Sep 28, 2018

Implemented in 0.3.0

0reactions
tlovettcommented, Jul 10, 2018

That works. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GOS, LLC: Home Page
Government Services and Consulting. GOS, LLC provides services to many branches of the federal government including defense, homeland security, intelligence ...
Read more >
GlobalOptions, now CoventBridge Group - LinkedIn
GlobalOptions has joined forces with ICS Merrill to created CoventBridge Group, the largest worldwide investigative services company providing: Surveillance ...
Read more >
GLOBAL OPTIONS definition | Cambridge English Dictionary
a general set of instructions that a computer uses when it is starting up which can be understood by any system · Want...
Read more >
Global Options Travel
WELCOME! Your exclusive travel and lifestyle benefits are within your reach. Login to Explore A World Of Savings. Remember Me Forgot Password?
Read more >
Options Settings - R
Allow the user to set and examine a variety of global options which affect the ... For getOption , the current value set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found