Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to soft wrap line in Github Gist

Tags:

github

gist

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):

enter image description here

After saving (No line-wrap):

enter image description here How can I fix this?

like image 264
Amita Avatar asked Mar 21 '20 18:03

Amita


People also ask

What is soft wrap in github?

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.

What is soft wrap text?

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).

What is soft wrap Pycharm?

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).


1 Answers

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.

like image 67
Dinko Pehar Avatar answered Oct 19 '22 07:10

Dinko Pehar