Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Behind the Scenes
  3. Qt.io webservices
  4. Change of formatting of code wrapped sections on devnet?
Forum Updated to NodeBB v4.3 + New Features

Change of formatting of code wrapped sections on devnet?

Scheduled Pinned Locked Moved Qt.io webservices
14 Posts 6 Posters 5.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    koahnig
    wrote on last edited by
    #1

    Apparently the code wrapping has been changed. Long code lines were displayed in code wrapping as long lines with a slider to move along. However, this is not working anymore see this "formatting of code":http://developer.qt.nokia.com/forums/viewthread/13880/
    In my Chrome browser it looks like this
    !http://db.tt/VIeb4AJ6(example)!

    There is a line break introduced at the first "space". When removing the "space" it breaks at the "-" very early in the line.

    Vote the answer(s) that helped you to solve your issue(s)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Hmmm... that is annoying. Code should not be wordwrapped, ever. It may be significant.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lgeyer
        wrote on last edited by
        #3

        ... and it mostly leads to unreadable code. +1 for the old behaviour.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          In fact, I considder this a bug. Please file a bugreport.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            On popular demand I have filed a "bug report on JIRA ":https://bugreports.qt-project.org/browse/QTWEBSITE-390 :-)

            [quote author="Andre" date="1327745498"]Code should not be wordwrapped, ever. [/quote]

            I do not agree completely with statement. When the code line is exceeding the window size several times it is annyoing to scroll along. So there it would be nice to have the wrap.
            However, it might be complex to solve and such cases should be rare and edited by hand.

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              No, I stand by my statement. Code can be wrapped on /n just fine, but that is always explicit. The layout engine is being told by the user to wrap at a specific place. I encourage that completely! A single statement, for instance with a list of long-ish arguments, should be broken up into multiple lines. However, that is not word-wrapping. Word wrapping is automatically wrapping the lines based on word boundaries. That works fine for normal text, but not for code. I want the 'const' to stay with the variable name, thank you very much.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                koahnig
                wrote on last edited by
                #7

                [quote author="Andre" date="1327750845"]No, I stand by my statement. Code can be wrapped on /n just fine, but that is always explicit. The layout engine is being told by the user to wrap at a specific place. I encourage that completely! A single statement, for instance with a list of long-ish arguments, should be broken up into multiple lines. However, that is not word-wrapping. Word wrapping is automatically wrapping the lines based on word boundaries. That works fine for normal text, but not for code. I want the 'const' to stay with the variable name, thank you very much. [/quote]

                I completely agree if your initial statement is interpret word-by-word. Source code lines should be smartly wrapped. Developers not doing this have to live with the pain. And for sure they do :-)

                My view was a bit focus on the display in devnet though. "Code" I have interpret as code section. The code sectioning is used also to display error messages in posts. Especially within error message for templates used causing a compile error. At least the ms compiler some times displays messages stretching for ever. Copy and pasting them to devnet code section caused in the past that you have to slide through several window sizes. This is annoying and does not help.
                I was wondering, if such situations were the origin of changing the behaviour of displaying the code section. If so, I would prefer to have an automatic wrap after 2 times the windows size may be. But again I think it is too complex and/or too time consuming lateron.

                Vote the answer(s) that helped you to solve your issue(s)

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #8

                  Ah, ok. I guess you are right about issues with displaying long error-messages or other similar things. The root of that issue is, of course, that we are -abusing- using code tags for these as well. With good reason, of course, but you cannot exect a layout engine to on the one hand not touch code, but on the other wrap around non-code-but-still-code-like sections. We'd need some way to identify what it is we are posting. That would be useful anyway. Hightlighting also isn't quite the same for python, C++, javascript or QML, so it would be useful to have a distinction there.

                  Personally, I like parts of the syntax we have here, but not all of it. It gets in the way far to easily. While it is convenient that you can use underscores for italic instead of [i]...[/i], for code, it creates problems. I would much rather just have [ code] [ /code] and then be able to say [code lang:cpp], [code lang:qml] or [code lang:log] to tweak how whatever is in that block is rendered.

                  _Edit: Hmm... code between square brackets seems to work already

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    miroslav
                    wrote on last edited by
                    #9

                    I think any solution is acceptable that marks wrappings in a way that they are clearly visible to the user. Personally I prefer code wrapping (with markers) to no code wrapping).

                    In KDE we would make it a user preference :-)

                    Mirko Boehm | mirko@kde.org | KDE e.V.
                    FSFE Fellow
                    Qt Certified Specialist

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on last edited by
                      #10

                      Just for information:
                      The change is live since a change of the code formatting engine. It has moved from some JavaScript on the browser side to the server side.

                      I'd prefer no line wrapping for the actual code together with some wrapping "show this as plaintext" like tag for logs etc.

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        koahnig
                        wrote on last edited by
                        #11

                        Oh, the discussion goes beyond the initial reason of a probable bug.

                        I like the idea being able to specialize the code section.

                        Should we formulate a suggestion then?

                        BTW: I have seen the wrapping with "code" in square brackets before in soem posts. However, it is not a documented feature in "ForumHelp":http://developer.qt.nokia.com/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01

                        Vote the answer(s) that helped you to solve your issue(s)

                        1 Reply Last reply
                        0
                        • G Offline
                          G Offline
                          goetz
                          wrote on last edited by
                          #12

                          The markup "language" behind DevNet is "textile":/search/tag/textile. Most of its syntax works here too, including [ code ] (without the nice syntax highlighting, though).

                          http://www.catb.org/~esr/faqs/smart-questions.html

                          1 Reply Last reply
                          0
                          • K Offline
                            K Offline
                            koahnig
                            wrote on last edited by
                            #13

                            [quote author="Volker" date="1327757076"]The markup "language" behind DevNet is "textile":/search/tag/textile. Most of its syntax works here too, including [ code ] (without the nice syntax highlighting, though).[/quote]

                            Good to know, thanks

                            Vote the answer(s) that helped you to solve your issue(s)

                            1 Reply Last reply
                            0
                            • M Offline
                              M Offline
                              mgran
                              wrote on last edited by
                              #14

                              Thanks for feedback, as Volker said we changed the syntax highlighter engine away from a browser based JavaScript solution to a server side solution. This prevents the "jumping around" of text on page load if you're not on a low latency connection. Good for performance overall. And we had a fair share of cross-browser issues with the old solution. 0 so far with the new one.

                              I'll check if we can make code wrapping a user preference.

                              Project Manager - Qt Development Frameworks

                              1 Reply Last reply
                              0

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved