-
Notifications
You must be signed in to change notification settings - Fork 275
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
Remove dollar sign from README.md commands #584
Conversation
Ultimately, I look to @amacneil to decide how he wants the documentation formatted for this project, but here are my two cents: My first 1¢ - Prefixing command-line interface examples in documented with the shell prompt character is a very well understood, long-standing convention for formatting command-line interface examples. Rather than me doing a poor job of trying to describe the how's and why's, I recommend people read the Google developer documentation style guide's command-line syntax page, to provide context for what I write next. Historically, the importance of including the prompt in the command-line interface documentation was to signal to the reader whether the command was expected to be executed as an unprivileged (non-root) user, indicated by the In modern times, the best practice is to prefix privileged commands with Ultimately, examples are convenient if and when they can be copied and pasted verbatim by the reader, but that should not be the expectation. Documentation serves to inform a wide range of readers, who are expected to adapt the information presented to their specific situation, of which there are too many to accommodate in the documentation, and would create more confusion by even trying to do so. My second 1¢ - I personally find it frightening how comfortable users have gotten with the practice of blindly copying commands and executing them, sometimes even with privileged (root) contexts. If you truly are not concerned with this, and are simply looking to make copying and pasting commands from documentation more convenient, you could do this: $ echo 'exec $@' > /usr/local/bin/\$
$ chmod +x /usr/local/bin/\$ This will create a command named Once you've performed the two commands above, you can copy and paste this directly into your shell: $ echo hello world
$ date And, it will effectively ignore the leading Now, this is an absolutely horrible idea and I feel terrible even documenting such a recommendation, but if you've committed to just copying and pasting commands wholesale into your command prompt, you may as well do this as a quality-of-life improvement for copying and pasting commands from all conventional documentation that uses Unfortunately, the same trick cannot be done with ... There are my 2¢ on the matter. As I wrote earlier, ultimately it's up to @amacneil, but it is my opinion and personal preference to reject this PR and any that propose the same change in the future. But, there are certainly benefits of doing it the way this PR proposes, and perhaps it's time to change the well-established standard. Thanks for initiating the discussion. |
Thanks for the thoughts. I generally agree with @dossy here, I think some of the updated examples in this PR are a lot less clear, especially when mixing shell commands and output. For example: cat .env
DATABASE_URL="postgres://[email protected]:5432/myapp_development?sslmode=disable" The correct solution would be for github to correctly disable copy paste of leading I do see that this is a slight pain point when copying the install instructions though. These are also all one-liners and don't contain any stdout. I therefore propose accepting the proposed changes to the "Installation" section, and rejecting the rest. Thoughts? |
Stylistically, it makes me a bit sad, but pragmatically, this seems like the best compromise. I do agree that removing the prompt character where the command and its output are combined in the same block reduces readability and clarity, and should be rejected. |
b8cb4c1
to
c2d1632
Compare
currently when copying code snippets one has to manually remove the dollar sign first. Consider:
bash: $: command not found
fish: Expected a variable name after this $.
vs.