klmr / klmr/box

inputting portions of a script

Open
#289 0 comments 0 reactions 0 assignees View on GitHub
✨ new feature
Dominant language
R
Stars
979
Forks
49
PR merge metrics
No merged PRs in 30d

Description

Not sure if this is within the scope of box but if box is regarded as a better way to use scripts then perhaps it is.

The feature would be to allow reading just part of a script. There would be some syntax that the script could use to define chunks and then box could source just specified chunks.

Some examples of use would be:

- have a chunk of functions and then various chunks giving runs with alternative data. That would allow everything to be stored in a single script.
- have a script with functions and then have alternative codes to run it with different parameters
- have a script with functions and code to use them but then allow a second script to run just the functions without running the code to execute them so it can use its own code to run them.

Presumably there would be some syntax like this that the script could use.

```
#!! chunk_name
lines of code

#!! another_chunk_name
lines of code
```

The box command or some other command would have an argument that specifies the chunk(s) to run.

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or specific entry points. Start by determining how box currently sources scripts and handles command arguments; then define chunk syntax and selection behavior. Done should include a working way to source selected chunks, support the described use cases, and tests covering chunk parsing and execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.