I have a long string that I want to embed in my blog using Github Gist. I want to enable line-wrap for it, so that readers don't have to scroll right to view the entire string. Even after clicking the 'soft-wrap' option while editing, the final gist is not wrapped.
While editing (Soft-wrap enabled):
After saving (No line-wrap):
How can I fix this?
Github doesn't soft wrap any of the code files, including txt files. Wrapping is only applied to prose documents, such as markdown and rst documents. The solution to your problem would be to rename gist from sample_text.py to sample_text.md and apply Soft wrap . That would produce desired effect you want to achieve.
A soft return or soft wrap is the break resulting from line wrap or word wrap (whether automatic or manual), whereas a hard return or hard wrap is an intentional break, creating a new paragraph. With a hard return, paragraph-break formatting can (and should) be applied (either indenting or vertical whitespace).
Wrap lines to eliminate the need of scrolling horizontally in order to see overly long lines. Enable soft wraps for the file types that tend to have lots of long lines (Preferences/Settings | Editor | General > Soft-wrap files).
Github doesn't soft wrap any of the code files, including txt files. Wrapping is only applied to prose documents, such as markdown and rst documents.
The solution to your problem would be to rename gist from sample_text.py
to sample_text.md
and apply Soft wrap
. That would produce desired effect you want to achieve.
Read this conversation on Github community for more context.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With