Uh oh!
There was an error while loading. Please reload this page.
Don't include ">" in bash scripts - #460
Conversation
spastorino
commented
Oct 7, 2019
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 |
hbina
commented
Oct 7, 2019
But the "copy to clipboard* button will copy the entire text, including the |
FWIW, it's generally incorrect to use |
spastorino
commented
Oct 7, 2019
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 |
tshepang
commented
Oct 7, 2019
I myself use prompt characters only when including command output (for easy visual separation), otherwise I do not add it for copy-paste convenience. |
mark-i-m
commented
Oct 10, 2019
@tshepang That seems like a reasonable rule to me |
spastorino
commented
Oct 11, 2019
So in order to make progress with this my suggestion is ...
|
mark-i-m
commented
Oct 11, 2019
@spastorino I don't know how to do #2 in mdbook, but it sounds good to me. |
mark-i-m
commented
Nov 14, 2019
@hbina Thanks for the PR! Are you still interested in working on this? If so, could you remove all the |
hbina
commented
Nov 14, 2019
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 |
spastorino
commented
Nov 14, 2019
@hbina going over the first one is good enough for now :) |
mark-i-m
commented
Nov 14, 2019
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".
| ```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 |
mark-i-m
commented
Nov 18, 2019
@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... |
spastorino
commented
Nov 18, 2019
@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. |
mark-i-m
commented
Nov 21, 2019
Umm... looks like rebase went wrong? |
hbina
commented
Nov 21, 2019
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...
hbina
commented
Nov 21, 2019
Should be okay now? |
mark-i-m
commented
Nov 21, 2019
Yeah, I'm not really sure why that happens. Occasionally I do that too. For whatever reason, |
mark-i-m
commented
Nov 21, 2019
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.
ghost
commented
Sep 20, 2020
This code blocks should not be marked as |
shepmaster
commented
Sep 20, 2020
|
This makes copying inconvenient as
> ./x.py build -i --stage 1 src/libstdwill actually render yourx.pyfile empty...