3

Just saw a question in which the OP indicates a code in plain text:

find /opt/backup/test -name "*.gz" -exec smbclient -A /opt/backup/smbclient_authentication.txt //1.1.1.1/test -c put '{}' \

I wanted to use code-sample to format it, but I got this:

find /opt/backup/test -name "*.gz" -exec smbclient -A /opt/backup/smbclient_authentication.txt //1.1.1.1/test -c put '{}' \

which is not easy to read.

Would it be correct to blockquote it instead?

find /opt/backup/test -name "*.gz" -exec smbclient -A /opt/backup/smbclient_authentication.txt //1.1.1.1/test -c put '{}' \

It was finally edited like this:

$ find /opt/backup/test -name "*.gz" -exec smbclient -A \
/opt/backup/smbclient_authentication.txt //1.1.1.1/test -c put '{}' \

but I do not want just to focus in this case, but in general.

Is there any rule (written or "in the air") to handle this code presentation?

  • The last edit is the correct one. This will work in all cases except for those languages like Python which are whitespace sensitive, in which case it is better just to leave it in its original form. – Robert Harvey Apr 26 '13 at 15:41
  • Thanks, @RobertHarvey, so it is better to Blockquote when having a too long line to code-sample it. – fedorqui May 1 '13 at 13:54
  • Horizontal scrollbars are not the end of the world. I try to avoid them, but sometimes that is not possible. – Robert Harvey May 1 '13 at 14:49

You must log in to answer this question.

Browse other questions tagged .