Nominate our 2022 Qt Champions!

Text attributes impact with some common characters

  • Hi to all,

    When explaining commands maybe useful to adopt the common methods to put (for example) in bold the command name and in italic the parameters. Regarding parameters the square brackets represents usually optional parameters and angle brackets mandatory parameters. This is an example of what I mean:
    $test_command [option1,[option2[...]] <mandatory_value>
    above the example is in a code section, so it is readable. But whe yo should insert it in a line of text like this $test_command [option1,[option2[...]] <mandatory_value> trying to assign bold and italic attrbutes the effect is the following: $test_command [option1,[option2[...]] <mandatory_value> while using spaces before the attribute characters the effect is the following: * $test_command * _ [option1,[option2[...]] <mandatory_value> _

    Non of these cases reports a correct result and not always the use of the code formatting coomand increase the readability of the text. Is there some way to represent correctly these characters ?

  • It is very difficult to add manual formatting to code sections. The problem is, that every character in code sections is important; you need to present it as-is, because otherwise you may end up changing actual code to formatting and thereby hinder clear communication.

    However, perhaps there is a way to do it; as I think that for instance pastebin does support some additional formatting by putting some special character as the first character on a line.

  • Thank you,

    this is what I supposed Andre but as a matter of fact this is not what we strictly define online code. For this case it is excellent the use of the '@' ... '@' characters. The problem is when the text will show any kind of string that has these characters and is NOT code.

    The simplest example is when - as is a common use - someone in the forum post a replay to a specific user. If I will write

    @Andre: Hello Andre

    I can't use in the same post the '@' character alone to avoid the code effect shown in the text.

  • Indeed. That's why I think that the choice to use these short codes in this forum was wrong, even if they are often convenient. I think it is OK to use _ and * directly around a single word to make that word appear in italics or bold, but otherwise the format used on many forums with square brackets is much more reliable. Using @ signs around a code section was a bad idea(TM).

    However, it is what it is, and this is not something that can easily be fixed. For one, a change like this would break formatting on all existing posts, unless you actually somehow automatically change the formatting codes in the posts.

  • I agree: it what it is :)

    Thank you.

Log in to reply