Don't include ">" in bash scripts#460
Don't include ">" in bash scripts#460mark-i-m merged 1 commit intorust-lang:masterfrom hbina:patch-1
Conversation
|
We could use a $ sign but please check out through the whole guide because there are tons of "```bash" pieces and we would need to update them all. |
I don't quite understand. Even if I replace
Okay, I am going to apply the changes to all of them now.... |
Yeah, I just meant that would be a bit more obvious that you don't need to copy if you have |
|
But the "copy to clipboard* button will copy the entire text, including the |
FWIW, it's generally incorrect to use |
|
Sorry because I may be having hard time to express my idea :). I feel like in these blocks we should have just the thing that needs to be run, in this case Also what @shepmaster says is true. I'm not sure what would be the best solution /cc @mark-i-m |
|
I myself use prompt characters only when including command output (for easy visual separation), otherwise I do not add it for copy-paste convenience. |
|
@tshepang That seems like a reasonable rule to me |
|
So in order to make progress with this my suggestion is ...
|
|
@spastorino I don't know how to do #2 in mdbook, but it sounds good to me. |
|
@hbina Thanks for the PR! Are you still interested in working on this? If so, could you remove all the |
|
Uh oh, I guess I better start finish reading the book. Sure, I can work on them. I only know how to do the first one tho, I am not entirely knowledgeable in CSS styling stuff |
|
@hbina going over the first one is good enough for now :) |
|
I think we can leave CSS for a follow-up pr. For now, perhaps we can start by just removing the characters? |
|
My latest commit removes a bunch of |
spastorino
left a comment
There was a problem hiding this comment.
I see you did you added some of the $ but seems opposed what we are trying to do.
To be honest unsure how to best fix this without doing the css styling idea.
@mark-i-m do you have any other idea?.
|
|
||
| ```bash | ||
| > perf focus '{do_mir_borrowck}' --tree-callees --tree-min-percent 3 | ||
| $ perf focus '{do_mir_borrowck}' --tree-callees --tree-min-percent 3 |
|
|
||
| ```bash | ||
| > perf focus '{do_mir_borrowck}..{^rustc::traits}' | ||
| $ perf focus '{do_mir_borrowck}..{^rustc::traits}' |
|
|
||
| ```bash | ||
| > perf focus '{do_mir_borrowck}' | ||
| $ perf focus '{do_mir_borrowck}' |
There was a problem hiding this comment.
I thought the text below this are meant to show an example of what will be displayed? In this case, the "copy to clipboard" button is meaningless regardless. So thats why I thought adding $ is okay to convey what would appear in a console. My original PR was really about "texts that are meant to be executed, should be executable from what is copied to the clipboard".
src/how-to-build-and-run.md
Outdated
|
|
||
| ```bash | ||
| > rustc +stage1 -vV | ||
| $ rustc +stage1 -vV |
There was a problem hiding this comment.
Hmm I see why you added $ there but I'm not sure what to think about this.
cc @mark-i-m
|
|
||
| ```bash | ||
| > perf focus '{do_mir_borrowck}' --tree-callees --relative --tree-max-depth 1 --tree-min-percent 5 | ||
| $ perf focus '{do_mir_borrowck}' --tree-callees --relative --tree-max-depth 1 --tree-min-percent 5 |
|
@spastorino Personally, I think this is ok. One would not copy/paste the whole block anyway in these cases, and I think having the prompt will improve the syntax highlighting of mdbook... IMHO, we should just merge... |
|
@hbina I've just approved the changes and I was going to merge them but there are some conflicts now, do you mind rebasing?. Sorry for not merging it before and hitting this new conflicts. |
|
Umm... looks like rebase went wrong? |
|
Oh...that's really bad... |
Specifically, `> $1` causes it to write into the file $1 if it exist And `> ./x.py` is particularly bad because it overwrite the script with empty spaces...
|
Should be okay now? |
|
Yeah, I'm not really sure why that happens. Occasionally I do that too. For whatever reason, |
|
Yep, that looks much better :) |
mark-i-m
left a comment
There was a problem hiding this comment.
Thanks! This looks good to me. We can do more discussion on zulip or in an issue I think.
|
This code blocks should not be marked as |
|
This makes copying inconvenient as
> ./x.py build -i --stage 1 src/libstdwill actually render yourx.pyfile empty...