LibraryCarpentry / lc-shell

Library Carpentry: The UNIX Shell
https://librarycarpentry.org/lc-shell/
Other
31 stars 85 forks source link

Break long input lines #263

Closed bkmgit closed 7 months ago

bkmgit commented 7 months ago

Make it easier to read text that is typed in.

If this pull request addresses an open issue on the repository, please add 'Closes #NN' below, where NN is the issue number.

Closes #262

Please briefly summarise the changes made in the pull request, and the reason(s) for making these changes.

Make it easier to read entered text

If any relevant discussions have taken place elsewhere, please provide links to these.

github-actions[bot] commented 7 months ago

Thank you!

Thank you for your pull request :smiley:

:robot: This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}.

If you have files that automatically render output (e.g. R Markdown), then you should check for the following:

Rendered Changes

:mag: Inspect the changes: https://github.com/LibraryCarpentry/lc-shell/compare/md-outputs..md-outputs-PR-263

The following changes were observed in the rendered markdown documents:

 06-free-text.md | 30 ++++++++++++++++++++----------
 md5sum.txt      |  2 +-
 2 files changed, 21 insertions(+), 11 deletions(-)
What does this mean? If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible. This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation.

:stopwatch: Updated at 2024-04-03 17:21:41 +0000

kaitlinnewson commented 7 months ago

Hello @bkmgit, thanks for your pull request. Unfortunately we won't merge this, as it does not give us the correct output. Breaking into multiple lines also makes it harder for learners to copy and paste commands when they need to.

Here's an example screenshot of one of the rendered changes for reference: Screenshot 2024-04-08 at 9 16 02 AM

bkmgit commented 7 months ago

@kaitlinnewson Thanks for considering and reviewing it. Generally copy pasting is discouraged as it does not build muscle memory. The text that would be entered would be

tr -d '[:punct:]\r' < gulliver-noheadfoot.txt > \
gulliver-noheadfootpunct.txt

but typically the terminal also contains a $ and > which the user does not enter. Is the output wrong when this is done? Keeping the line length short is done in a few other curricular that use the shell, so if it is confusing, it would be good to know how it could be improved.

kaitlinnewson commented 7 months ago

@bkmgit The commands as they are written in the PR result in a duplicate ">" character, one on each line, as you can see in the screenshot above that shows the rendered lesson content.

I took a look at some of the other lessons in the Carpentries materials, and breaking long commands on to multiple lines isn't being done elsewhere - I think one reason is that it adds complexity to teach the learner about breaking commands on to multiple lines, and there are no guarantees about the screen size a user has. We want to ensure that there is consistency across the lesson materials.

While I know that copying and pasting isn't ideal, we still want to make sure learners are able to do that easily in cases where they need to - and instructors may need to do that easily as well while they are teaching.