-
Notifications
You must be signed in to change notification settings - Fork 7
Document existing target block behavior #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,28 @@ Execute (Eval source block with named target): | |
| Then (Output written to named target block): | ||
| AssertEqual 'computed', getline(8) | ||
|
|
||
| " === Existing named target keeps its fence === | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again it seems to me like this test case is the same as the one line 19? Unless the behavior you are testing is that "when the target block is not empty, the contents are completely replaced". Which is a fair thing to have test coverage for and is different than the first test case. But in that case we should reword/rephrase the test case.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed. Maybe we don’t need that test at all, it is pretty redundant. |
||
|
|
||
| Given markdown (Existing target block is not recreated): | ||
| <!-- target: existing --> | ||
| ```sh | ||
| echo 'updated' | ||
| ``` | ||
|
|
||
| <!-- name: existing --> | ||
| ```text | ||
| old output | ||
| ``` | ||
|
|
||
| Execute (Eval source block writes into existing target): | ||
| 3 | ||
| EvalBlock | ||
|
|
||
| Then (Fence stays unchanged and contents are replaced): | ||
| AssertEqual '```text', getline(7) | ||
| AssertEqual 'updated', getline(8) | ||
| AssertEqual '```', getline(9) | ||
|
|
||
| " === EvalBlock from destination block redirects to source === | ||
|
|
||
| Given markdown (EvalBlock in destination block evaluates its source): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious why the example just above this one (lines 42-49) doesn't already make this clear? Can that example me clarified or disambiguated in some way to make it clearer?
With this PR it seems like we are just demonstrating the same thing twice in a row
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, the example below shows something similar: a python block that emits a language-less block.
This documentation is more of a use-case POV: I did not imagine that could already change the language of the emitted block.