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

Wiki-Style syntax for posting

by Anonymous Monk
on Oct 14, 2008 at 16:53 UTC ( #717040=monkdiscuss: print w/replies, xml ) Need Help??

I recently posted a question to "Seekers of Perl Wisdom", and I got quick and excellent help, thanks a lot!

However, as first-time user I was a little annoyed by the old-fashioned input box. It's too narrow and it eats new-line characters by default, so it forced me to litter my text with cumbersome <br> tags.

Not everyone is conversant with HTML, and, for the occasional posting, I don't want to go through the "approved html tags" list or the like.

I find the wiki syntax easier to use (more intuitive). That could be provided as an option. For the real lazy, or for short questions, an option for plain-text format would be better suited.

Many thanks, and keep up the good work!
Ruben

Replies are listed 'Best First'.
Re: Wiki-Style syntax for posting
by ikegami (Pope) on Oct 14, 2008 at 17:10 UTC

    However, as first-time user I was a little annoyed by the old-fashioned input box. It's too narrow

    I agree, but you can make it bigger using CSS. In my Display Settings, I added

    /* Increase size of text input areas. */ textarea { width: 100%; height: 25em; } table.user-settings, .user-settings textarea { width: 100%; }

    Not everyone is conversant with HTML

    And even fewer with whatever wiki dialect you had in mind.

    and, for the occasional posting, I don't want to go through the "approved html tags" list or the like.

    You shouldn't have to ever look at that list. Only the exotic isn't allowed. The only special item you need to know is that it's much easier to use <c>...</c> to post code and data.

    so it forced me to litter my text with cumbersome <br> tags. I find the wiki syntax easier to use (more intuitive).

    Then you're doing something wrong. You should rarely have to use <br>. Just put a <p> at the beginning of every paragraph. I don't see how it could be more intuitive.

    Update: Spelling fix

      I agree, but you can make it bigger using CSS. In my Display Settings

      Can you, as Anonymous Monk?

        I generally use the It's All Text! extension for Firefox, then I can click the "edit" button on any textarea and modify it in my own editor.

        --
        andrew
        No, not without GreaseMonkey or some other external tool. That's why I said I agree with that recommendation.

      I suspect the horse may be dead from all this flogging, but here goes...

      About those open-P and close-P tags:

      Just about every note I have written here has a similar history:

      • Position at start of text area above my sig;
      • type first 'para';
      • type Enter-Enter;
      • type next para;
      ... and either at this point or after hitting 'Preview', thinking 'Oh, tut!' and entering </p><p>between each para, then jumping to the top and putting in an initial <p>.

      Now there are a couple or three places in this thread where venerable members of the Monastery have said words like (my apologies, I'm not au fait enough to do the linking trick)

      Just put a <p> at the beginning of every paragraph
      , and :
      you just need <p> for paragraphs and <code>...</code> for code

      So I have had a little follow-on question: how strict/forgiving are the "PM HTML recommendations", specifically with regard to whether the closing tags are required?

      Update: I followed the recommendation in Markup in the Monastery to maximise my HTML 'error reporting', and that went some way to answering the question. It seems that:

      • if I omit an initial <p> I am forgiven but the next </p> is, unsurprisingly, flagged;
      • the Monastery markup does prefer writers to close paras with a proper </p> tag but tolerates those who don't use one.

      So although I think I don't have the question I had when I started, I shall leave this post here as it may help others in a similar situation; and may act as a recommendation to turn on that HTML check in your Display Settings!

      This signature will be ready by Christmas

        So I have had a little follow-on question: how strict/forgiving are the "PM HTML recommendations", specifically with regard to whether the closing tags are required?

        Closing a P element is done implicitly in the absence of closing tag, both in HTML and on PerlMonks. I've never had a problem there. On the other hand, I've had problems omitting closing tags for table-related elements on PerlMonks, even though it was valid HTML.

        Considering that the HTML DTD specifically allows the close tag of the P element to be optional (on the account that the close tag can be inferred), I'm surprised the recommendation here is to use the close tag. That sounds very un-Perlish - and more Pythonesque.

        Not that I ever do ;-) (Nor do I use close tags for LI)

        you just need <p> for paragraphs and <code>...</code> for code

        I'm replying to you because you're just the first one (from a search POV, top-to-bottom) to point out so, and it's fundamentally true: I would call it the zeroeth-order approximation to the Truth™ ;) Now, to be admittedly fussy and since nobody else seems to have mentioned them yet, I would add that before any other "cosmetic" tag would come PM-specific <readmore> and (to a lesser extent) <spoiler> ones which are sometimes recommended, to define the first-order approximation.

        As for the level of strictness at the monastery, I don't have time enough to follow the subthread(s?) that this issue spawned, but as far as I'm concerned I close all tags: indeed I'm pretty much always writing xhtml nowadays, whenever I have to "write *html" that is - I feel more comfortable and psychologically at ease. And it's not tiresome for me in any way. You may check that by inspecting the xml source of my nodes, well at least since some years on...

        --
        If you can't understand the incipit, then please check the IPB Campaign.
      The proper way to do this is with a bookmarklet, since the design of many sites often fails for a user with different settings than the artiste who conceived it.

      --
      In Bob We Trust, All Others Bring Data.

Re: Wiki-Style syntax for posting
by moritz (Cardinal) on Oct 14, 2008 at 17:05 UTC
    I have two comments on this one.

    First it would be very cool to have alternative markup formats. I for one would very much like to have POD or asciidoc, but with perlmonks' powerful linking scheme. That said I guess it's rather much work, but so far I'm not a developer here.

    My second comment is that for most nodes you just need <p> for paragraphs and <code>...</code> for code. Perhaps [...] for links, but that's about it. If you want to get an answer, I think it's not too much to ask to invest some time into the prerequisites (here: markup).

      I can't see the point in having a number of input methods.

      If people get confused by one - or don't bother to learn how to use one - then how much more confused will they be by many?

        It's not for those who are confused, but for those who write a lot. Or for those who don't want to learn markup, but happen to know one of the offered alternatives.

        (I personally like POD because you don't need to mark paragraphs, C<...> is less to type than <c>...</c> and code blocks can be simply achieved by indenting a paragraph.)

        I can't see the point in having a number of input methods.

        I personally believe that I can see one: TMTOWTDI. Some people may feel at ease with HTML-like markup, others with the alternatives suggested thus far. You're comparing two uncomparable thought categories: people appearently/supposedly get confused by the mechanisms of one editing methods. Not by the fact that there's one editing methods, or that there may be more, FWIW.

        --
        If you can't understand the incipit, then please check the IPB Campaign.
Re: Wiki-Style syntax for posting (DWIM)
by tye (Sage) on Oct 15, 2008 at 03:54 UTC

    Yeah, I think this argues for making much more focused hints. Just note P tags and CODE tags (and that < and [ might need CODE tags), quite concisely, with examples, directly above the Title box (with a ?-style link to more detailed help). (Maybe also discourage BR tags; we hates them fat, stupid, nasty habitses.)

    As for more DWIM, I wouldn't do any of the many "wiki" mark-up styles nor would I do POD (at least at first). But I would like to take a couple of good ideas that are common to many of those:

    1. Turn blank lines into <p> tags
    2. Enclose indented blocks in <code> tags

    Another DWIM feature that I'm surprised has never occurred to me before nor do I recall ever having seen it suggested: Require a space (or open paren or quote) before and not after [ for it to be transformed into a link (for users who haven't chosen "expert" mode).

    I think those three "simple" DWIM features would eliminate a sizable majority of the formatting mistakes here. There is a bit of a trick in how to decide whether to apply those features to a particular node.

    I think the most likely way to get this is to add a "format type" field to all write-ups and as a user setting. The choices would need to include at least "traditional PM" formatting that does no DWIM (for existing write-ups and for users who don't want any "improvements") and a "DWIM" formatting that uses the above 3 DWIM features while allowing all of the traditional PM mark-up. I'd probably just have all users default to "DWIM" formatting for their future nodes. A per-node over-ride would also be nice, especially for persistently anonymous monks.

    It might be worth-while to have other formatting choices but I've talked myself out of all of the other options I've considered recently. I even considered having a UTF-8 format option, but I think it would be better to just convert the database en masse to UTF-8 (which would also tempt me to restrict the character set for node titles, but then Perl 6 would just use some such restricted obnoxious character for some strange operator and then we wouldn't be able to talk about it properly).

    Oh, I just did some spelunking via SQL and my nefarious plan for /(?![^\s(>"])\[(?!\s)/ being optionally required for links to be expanded appears to indeed be a very effective heuristic. :)

    I will try to get around to trolling the recent previous suggestions for how to redo the "hints" and come up with my own exact recommendation for the new to-the-point and in-your-face hints.

    - tye        

      IMHO this would be by far the most important change (in a positive sense) to this website since I'm a perlmonk.

      I have used up many hours on perlmonks, learned a lot but also wasted quite a few hours. The wasted hours were on account of typing all that <p> markup and having to read all the unformatted and unreadable questions of anonmonks and posting something like "Please use p- and c-tags...".

      And yes, I don't believe it is the fault of lazy (anon)monks that so many don't use the markup. A big reason ist that the information comes after the input box. And gives a lot of information and links, but never directly talks about just the two tags needed for 99% of all nodes by new users (i.e. the code tag is only mentioned indirectly as something to use if you wanted pre-tags. My knowledge of HTML is from a time when I used <verbatim> for code, didn't even know pre-tags).

      Even if we subscripe to the 'lazy' argument, that lazyness also hurts the readers of a node, not only the writer.

      In other words, mighty ++ for these changes.

        When I first started at Perlmonks, my knowledge of HTML proved to be a hinderance. Because <code> is a valid HTML element.
      Just note P tags and CODE tags (and that < and [ might need CODE tags), quite concisely, with examples,
      Something on the order of the approach in <shameless promotion> [id://674668 </shame>?

      Update: corrected link: Markup in the Monastery

        <shameless promotion> [id://674668 </shame>
        Wow, you open a shameless promotion tag and then close the shame tag … I guess it's a good thing to be shameless when you try to process markup like that (especially when linking to Markup in the Monastery!).
      As for more DWIM, I wouldn't do any of the many "wiki" mark-up styles nor would I do POD [...] I think those three "simple" DWIM features would eliminate a sizable majority of the formatting mistakes here. There is a bit of a trick in how to decide whether to apply those features to a particular node.

      I personally believe that (oh, ++, BTW!) one may reasonably argue that those three "simple" DWIM features could be considered a wiki-like markup language already. In fact they would make for a quick input method of formatted text.

      --
      If you can't understand the incipit, then please check the IPB Campaign.
Re: Wiki-Style syntax for posting
by GrandFather (Sage) on Oct 14, 2008 at 21:06 UTC

    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

      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

        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.
      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.
      <c> is a shortcut for <code>?
      # really? print "Holy crow, it is!!\n";
      Thanks GrandFather! That's a nice shortcut...

      Mike
Re: Wiki-Style syntax for posting
by LesleyB (Friar) on Oct 15, 2008 at 08:27 UTC

    Markup in the Monastery isn't that hard to read.

    Finidng one style of posting more intuitive than another is merely a matter of habit

    You've probably posted lots on wikis and not lots here. There was a time when you had to learn how to post in wikis and you are presumably at that stage with perlmonks.

    There will come a time when you find perlmonks posting intiuitive too.

        O hai, i haz tiepoze!

Re: Wiki-Style syntax for posting
by Jenda (Abbot) on Oct 14, 2008 at 23:19 UTC

    The box might be a bit bigger, but ... I don't really care. My browser (Google Chrome) let's me resize textareas.

    And ... I don't think asking for a very very basic knowledge of HTML on a forum for programmers is too much. Wait ... "approved html tags" list? I've never looked at the list until you mentioned it. As others said <p> and <code> is all you're gonna need most of the time.

Re: Wiki-Style syntax for posting
by Zen (Deacon) on Oct 15, 2008 at 16:45 UTC

    You'd probably make everyone happy with a short sentence by this input box, 'use <p> and <c> for...', and make a starting '<p>' the default.

      We could also make the default text for the textbox something like:

      <p>This is a paragraph</p> <code>#!/usr/bin/perl -w print "This is a block of code";< /code> <p>Yet another paragraph</p>

      That way, even if you had no idea why this way is recommended, you'd know that it was recommended. Signed in users would be able to turn it off in preferences, it turns itself off once you get beyond level 2 or 3, or it only appears for anonymous monks.

      ... or it'll backfire horribly and every new node will end up with "<p>Yet another paragraph</p>" stuck on at the end.

        I still think that, for newcomers asking simple questions, the HTML formatting gets in the way. But some default text inside the (still too narrow) input box would definitely help.

        I hope this subject does not get simply forgotten. Small details like this one don't really help banish the widespread prejudice that Perl is an arcane language, full of inconvenient oddities all over the place.

Re: Wiki-Style syntax for posting
by ambrus (Abbot) on Oct 18, 2008 at 10:22 UTC
    You can also try installing Regex replace your writeups: a free nodelet hack to your free nodelet. Just edit the default regex so it works with whatever idea you have about the wiki syntax.

    This has two drawbacks. Firstly, you have to remember to hit the button before you submit, though you could fix that with some addittional javascript code. Secondly, your wiki syntax to html converter has to be idempotent so if you do edits on an already htmlified preview it doesn't try to change the parts of the node that are already in html like the p tags.

Re: Wiki-Style syntax for posting
by tinita (Parson) on Oct 15, 2008 at 12:03 UTC
    I'd prefer bbcode. It's very widely known, can support many additional tags and is used successfully in many other programming boards. I have always wondered why perlmonks.org seems to dislike bbcode =)

      Because it sucks. BBCode was acceptable eight years ago because we just had nothing better. Frankly it's every bit as stupid and unintuitive to type as HTML, only with a fraction of the functionality.

      Markdown exists and has a huge installed userbase, most of the users not even realising it. The content of tye's ordered list above is a shining example.

      Wikicreole exists and has the clout of a sorta-standards process and comes with rationale and code and tests.

        I'm not disagreeing with your point, but:
        The content of tye's ordered list above is a shining example.

        Huh? Looks like plain ol' html to me. And afaik, perlmonks supports no kind of markdown; the only shortcuts are in making links, and the <code> tag.

        Because it sucks.
        well, at least you usually have paragraphs automatically. not like here where you have to add paragraph-html tags. and it's better than HTML because you don't need all the HTML functionality and people usually don't know HTML. *and* the markup used here is no HTML, only a kind of subset with additional tags. so at least compared to the current markup used here I think bbcode is better.

      Aren't you glad you asked? Certain monks are just to 1337 for your bbcode things. Old school html only! :) Btw, I prefer bbcode for speed purposes, so I do like this idea despite it being rejected.

Re: Wiki-Style syntax for posting
by marcussen (Pilgrim) on Oct 20, 2008 at 00:18 UTC

    Actually, although I am not endorcing BBcode, most forums have some simple buttons over their textarea that allows easy access to bold, italics, url, code, etc. Updating the input interface to support such buttons might allow users less familiar with html to make nicely formatted posts.

    On the other hand, if you cannot pick up some small bits of syntax as a programmer....

    Confucius says kill mosquito unless cannon

      Easy access to fancy formatting would make posts worse, not better. Just look at any of those forums with buttons and see what bloating forum signatures people add to their posts.

      Mosts posts don't need need more formatting than paragraphs and code tags. Italics can sometimes help if used very rarely and as skillfully as Arany János did in his poems. You do sometimes need other formatting, and some ideas are even best to be shown by a table or drawing, but it would be foolish to advertise such features or they'll be abused.

        I too have phat bloated sig pictures on the game forums I frequent, no matter what codebase the forums use or what features they offer. Compare this to the ascii sigs on newsgroups or perlish signatures here. Signatures seem to be more influenced by what the community as a whole adheres to rather than the ease of access to an IMG tag. Sure it might make perlmonks easier to troll, but most trolls would take the time to learn your forum software anyway, so I think that point is moot.

        I think you under estimate the usefulness of other tags such as strike through when editing ones own post, so although I agree with a minimalist approach I might like more formatting options than you. All in all the powers to be could choose which formatting options to make available as buttons (such as only having bold, italics, paragraph and code tag buttons).

        I also think you misread my desire for said buttons, I don't care for them or need them, but others might prefer them

        Confucius says kill mosquito unless cannon
Re: Wiki-Style syntax for posting
by Anonymous Monk on Oct 14, 2008 at 23:22 UTC
    Might give someone the impression to some that this is a wiki, it is not.
      Well before Wiki's where widely used those tags where called "Universal Bulletin Board Code Tags" they are meant for user posting and where made to restrict the use of Markup tags so the webmaster or programmer can pick and choose what they wanted to allow the user to use.
      Now that Wiki's use them the history of these tags has seem to of disappeared and it very much surprises me that none besides myself remember this.
      So to make a comment that there only for Wiki's and that people will confuse this site with a Wiki, seems like you have no knowledge of the true history of these tags.

      Spiel auf Hündinnen.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://717040]
Approved by Corion
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2018-12-18 11:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many stories does it take before you've heard them all?







    Results (79 votes). Check out past polls.

    Notices?