Search code examples
grailsgrails-2.0

How to make the grails 2 documentation quit generating a horizontal scroll bar?


Anyone out there still working with grails 2 applications, and noticed how the documentation on

https://grails.github.io/grails2-doc/2.5.6/guide/single.html

https://grails.github.io/grails2-doc/2.4.5/guide/single.html

https://grails.github.io/grails2-doc/2.3.11/guide/single.html

Require the use of a horizontal scroll bar and the Quick Reference Links are way off the screen?


Solution

  • This is caused by some really wide <pre> tags in the documentation.

    In Chrome you can fix this with a bookmarklet.

    Create a new bookmark with the following URL:

    javascript:(function() {var sheet=document.createElement('style');sheet.innerHTML="pre{white-space:pre-wrap}";document.body.appendChild(sheet)}())
    

    Here it is again formatted, but you will need to paste it as a one-liner.

    javascript:(function() {
        var sheet=document.createElement('style');
        sheet.innerHTML="pre{white-space:pre-wrap}"; 
        document.body.appendChild(sheet)
     }())
    

    enter image description here

    Next time you visit one of those pages, just click the bookmark and a second or so later you will get your Quick Reference to be quick again and no more horizontal scrolling.