feat: replace > notation with blank-line grouping for code blocks#87
Closed
maxim-uvarov-ai-assistant wants to merge 21 commits into
Closed
feat: replace > notation with blank-line grouping for code blocks#87maxim-uvarov-ai-assistant wants to merge 21 commits into
maxim-uvarov-ai-assistant wants to merge 21 commits into
Conversation
Updates testing commands to produce properly formatted JSON: - Add --quiet flag to testing-unit to suppress nutest terminal output - Pass --quiet from main testing when JSON output is requested - Use 'to json --raw' instead of 'to json' for valid JSON serialization This fixes JSON output format issues when running tests in CI/automated environments.
Updated todo file to define clear implementation goals for removing the `>` notation from numd code block execution. The new approach will parse entire blocks, group commands by double newlines, and output results in `# =>` comment lines.
- Rewrite execute-block-lines to split by blank lines instead of > prefix - Add split-by-blank-lines helper function - Remove > stripping from remove-comments-plus - Update clear-outputs to not preserve > lines - Update capture start to use inline # => output format - Add separate-block fence option for separate output blocks - Change create-execution-code to use separate-block option
- Update code block parsing explanation (6-point list) - Remove > notation from all code examples - Update help output examples - Remove reference to deleted types_of_data example
- Remove > notation from all example files - Update to blank-line grouping format - Regenerate # => output lines
- Update all _intermed.nu files with new execution format - Update stripped markdown .nu files
This example had persistent formatting issues with the new blank-line grouping format and is removed for now.
Update Example 2 to demonstrate the separate-block fence option which outputs results in a separate code block instead of inline.
When a command produces no output (like variable assignments), the blank line delimiter between command groups was being lost. This adds an explicit `print ''` after each command group execution to ensure visual separation is maintained in the output.
The --whole_block flag in create-execution-code was defined but never used in the function body. It became obsolete when the separate-block fence option was introduced. This commit removes the unused flag from: - Function signature - Example comment - Function call in execute-block-lines Also includes minor spacing beautification around closures.
…rt-options - get-last-span: Remove redundant str trim -c "\n" before str trim - check-print-append: Replace if/else returning booleans with single boolean expression - convert-short-options: Extract result to explicit variable for clearer flow
Simplify regex negation from `where not ($it =~ ...)` to `where $it !~ ...` and improve formatting of boolean conditions in check-print-append for consistency with recent refactoring.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
>REPL notation: Code blocks no longer require>prefix for line-by-line execution. Commands are now grouped by blank lines instead.# =>comment lines after each command group, keeping code and output together.separate-blockfence option: For cases where a separateoutput-numdblock is preferred over inline output.$in, cleaner negation syntax in where clauses, remove obsolete--whole_blockflag.Breaking Changes
>prefix is no longer recognized for REPL-style execution>notation need to be updated to the new formatTest plan
numd runworks on updated examplescapture start/stopuses new formattypes_of_dataexample (had persistent formatting issues)