djangoproject.com icon indicating copy to clipboard operation
djangoproject.com copied to clipboard

Code blocks may wrap awkwardly in small windows

Open dougvought opened this issue 9 years ago • 11 comments

I noticed a visual issue that caused me to incorrectly copy the code for this section: ​ https://docs.djangoproject.com/en/1.9/intro/tutorial05/#create-a-test-to-expose-the-bug

In the "Create a test to expose the bug" section, this code block in "polls/test.py"

#polls/test.py
#...
self.assertEqual(future_question.was_published_recently(), False)

gets pushed over and "loses" its tab, making it appear outside of the function scope.

To reproduce:

  1. Open a browser window (FireFox 46.0.1 or Chrome 50.0.2661.102 m) with a width greater than 822px
  2. Go to ​https://docs.djangoproject.com/en/1.9/intro/tutorial05/#create-a-test-to-expose-the-bug
  3. Resize the window so that its width is smaller than 822px
  4. The self.assertEqual part "jumps" to the same tab level as the QuestionMethodTests class.

documentation_tutorial05_self assertequal_tabbing

dougvought avatar May 31 '16 12:05 dougvought

Not sure the best way to handle this. I'd rather not change the overflow to add a horizontal scroll bar instead because I always find that annoying. If you copy and paste the entire code block, the tab is preserved.

timgraham avatar May 31 '16 13:05 timgraham

Would setting word-break: break-all; (MDN) for code example maybe help to reduce this kind of line breaks?

fabian avatar May 31 '16 13:05 fabian

word-break works in most cases, but it still makes things look awkward in a few cases

screenshot 2016-07-02 at 18 00 09

nanuxbe avatar Jul 02 '16 16:07 nanuxbe

can I work on it?

faizan842 avatar Jan 11 '22 16:01 faizan842

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 04 '22 04:10 stale[bot]

This is not stale. This is still a valid issue that is needed to be addressed.

Screen Shot 2022-10-04 at 9 00 33 PM

CuriousLearner avatar Oct 04 '22 15:10 CuriousLearner

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 03 '23 06:04 stale[bot]

@pauloxnet since old issues have now been triaged, how about disabling stalebot so we don't need to add comments to every issue every 6 months to prevent automatic closure?

timgraham avatar Apr 05 '23 11:04 timgraham

@pauloxnet since old issues have now been triaged, how about disabling stalebot so we don't need to add comments to every issue every 6 months to prevent automatic closure?

@timgraham activating the stalebot last year allowed us to close many old issues. I think an issue opened 7 years ago should be closed if no one takes care of it despite two reminders in the last year. As the removal of the stalebot is not only up to me, I think it is worth discussing it in a separate issue or on the developer mailing list.

pauloxnet avatar Apr 05 '23 12:04 pauloxnet

I created a django-developers stalebot thread.

timgraham avatar Apr 05 '23 21:04 timgraham

You were right to start the discussion on the mailing. I think it's best for developers to have a say on this, especially those who actively help resolve issues. I just hope this repository doesn't fill up with unfinished issues again, it took a lot to clean up the old bad issues.

pauloxnet avatar Apr 05 '23 21:04 pauloxnet