Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Wiki-Style syntax for posting

by GrandFather (Saint)
on Oct 14, 2008 at 21:06 UTC ( [id://717088]=note: print w/replies, xml ) Need Help??


in reply to Wiki-Style syntax for posting

You are not forced to use br tags. In fact I'd generally strongly discourage their use. Most often people use br tags to "format" their text into "nice" line lengths. That is a pure waste of effort, flies directly in the face of the intent of HTML and really pisses off anyone who doesn't agree with your concept of a "nice" line length.

For PerlMonks there are two markup tags you need to know 'p' tags and 'c' (or 'code') tags. Almost anything else is fancy and not required. The only other "Magic" that a frequent poster on PerlMonks needs to know is how to link stuff using [ and ].

So, two tags and one style of link magic to cover 90% of posts on PerlMonks. How hard is that to learn?


Perl reduces RSI - it saves typing

Replies are listed 'Best First'.
Re^2: Wiki-Style syntax for posting
by koolgirl (Hermit) on Oct 15, 2008 at 01:34 UTC

    A while ago, a few monks pointed out my mistake in using 'br' tags, not too shorten line length, but to have a single quote between two paragraphs. I only know enough HTML to "get by", using the term rather loosely, so I was grateful for the tips, and have since been using 'blockquote' tags, or even just 'p' tags.

    However, just to be curious, why exactly, are 'br' tags considered "bad" HTML? I mean, they do work, so is it sort of the same concept as a "bad programming habit"? Just wondering, I learn quite a bit from having mistakes explained to me :))

    P.S. Sorry to go off topic in the thread Monks...please forgive :))

      In addition to what GrandFather just said, <br> tags are considered bad HTML because they confuse structure and presentation. The reason CSS is such a good thing is that it allows you to completely separate your presentation (styles) from your markup (HTML). Having this separation of presentation and structure is good for maintainability. Anyone who's had to work on a website with lots of <font> tags can attest to that.


      email: perl -e 'print reverse map { chr( ord($_)-1 ) } split //, "\x0bufo/hojsfufqAofc";'
      'Under no circumstances should you program the way I say to because I say to; program the way you think expresses best what you're trying to accomplish in the program. And do so consistently and ruthlessly.' --Rob Pike

      br tags are not really bad as such. It's just that they tend to get used by noobs to "format" text to a "nice" length. For example, a noob might "format" this paragraph by inserting judicious br tags and end up with something like this:

      br tags are not really bad as such. It's just that they tend to get
      used by noobs to "format" text to a "nice" length. For example, a noob
      might "format" this paragraph by inserting judicious br tags and end up
      with something like this.

      Now try changing your browser's width (especially make it narrow) and see what happens to the two blocks of text.

      A minor issue is that often </br> is used instead of <br/>. </br> is just plain wrong.


      Perl reduces RSI - it saves typing

        </br> is just plain wrong.

        In HTML, it's "<br>".

        In XHTML, it's "<br></br>" (with nothing in the middle) or the equivalent shortcut "<br/>".

        So "</br>" is not "just plain wrong", only when used improperly.

      However, just to be curious, why exactly, are 'br' tags considered "bad" HTML?

      I didn't say they were bad, I said the OP's use of them was. P elements identify paragraphs, not BR elements.

      I personally believe that they are just as "bad" as \\'s are bad in (La)TeX: because they constitute ad hoc, "visual" formatting, whereas most systems insist nowadays that you separate as much as possible logic and sematic info from formatting. Occasionally, such unconditional line returns are necessary, and good. But in general one should not exaggerate with them.

      --
      If you can't understand the incipit, then please check the IPB Campaign.

        ++. The easiest way to know if the <br/> you've used is bad is if you've used more than one. Two is a guaranteed mistake. I could see special cases like line-breaks in poems and code allowing for one at a time but even with something like that you'll want <span/>s -- this is why I'd like to see the <l/> we're supposed to get one of these days -- because you'll be defining indentation/horizontal spacing too. <br/> is the vertical equivalent of &nbsp;. Just say no.

Re^2: Wiki-Style syntax for posting
by ikegami (Patriarch) on Oct 14, 2008 at 21:12 UTC
    One doesn't need to know [...] either. It's just easier to use than <a href="...">...</a> when you know how.

      Wouldn't [/] also allow the changing of the link style used if the destination changes its style. For example, if Google changed its URL for searching to something different, any link that was of the form [google://blah blah blah] could be re-formed by the page rendering code, right?

      --MidLifeXis

      For links within PM, I prefer it when people use [...]. When they write their own <a href... tags, they almost invariably do not use a relative URL but some form of absolute URL back to PM. Since PM is available at more than one host name, that is usually different from the domain for one person's login cookie or another. The shortcuts remove that concern.

      Part of that issue could be mitigated by scoping the cookies to the second-level domains rather than the hostnames. That would solve www.permonks.tld vs. perlmonks.tld as I discussed with jdporter last week in the CB. It wouldn't help any with the fact that perlmonks.org, perlmonks.net and perlmonks.com are all the same site, though. The shortcuts handle that just fine.

      Well, one doesn't need to use [ ], but one certainly does need to know about them. Considering that [ ] is dead common in Perl code, one does have to know about this unfortunate choice of alternative link markup.
Re^2: Wiki-Style syntax for posting
by RMGir (Prior) on Oct 15, 2008 at 13:16 UTC
    <c> is a shortcut for <code>?
    # really? print "Holy crow, it is!!\n";
    Thanks GrandFather! That's a nice shortcut...

    Mike

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://717088]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-18 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found