Lee_Dailey

Reddit_Code_Formatting_HowTo

May 16th, 2018
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. howdy ,
  2.  
  3. reddit likes to mangle code formatting, so here's some help on how to post code on reddit ...
  4.  
  5. [0] single line or in-line code
  6. enclose it in backticks. that's the upper left key on an EN-US keyboard layout. the result `looks like this`. kinda handy, that. [*grin*]
  7.  
  8. [1] simplest = post it to a text site like Pastebin.com or Gist.GitHub.com and then post the link here.
  9.  
  10. [2] less simple = use reddit code formatting ...
  11.  
  12. - one leading line with ONLY 4 spaces
  13. - prefix each code line with 4 spaces
  14. - one trailing line with ONLY 4 spaces
  15.  
  16. that will give you something like this ...
  17.  
  18. - one leading line with ONLY 4 spaces
  19. - prefix each code line with 4 spaces
  20. - one trailing line with ONLY 4 spaces
  21.  
  22. the easiest way to get that is ...
  23.  
  24. - add the leading line with only 4 spaces
  25. - copy the code to the ISE [or your fave editor]
  26. - select the code
  27. - tap TAB to indent four spaces
  28. - re-select the code [not really needed, but it's my habit]
  29. - paste the code into the reddit text box
  30. - add the trailing line with only 4 spaces
  31.  
  32. not complicated, but it _is_ finicky. [*grin*]
  33.  
  34. take care,
  35. lee
Add Comment
Please, Sign In to add comment