Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Convert Text to HTML Checkbox

by rjahrman (Scribe)
on May 29, 2003 at 00:49 UTC ( [id://261451]=monkdiscuss: print w/replies, xml ) Need Help??

I think that under the TEXTAREAs to enter a node there should be a "Re-Format as HTML" (or the like) checkbox that would, for example, replace > with &gt; and line breaks with <BR>.

Replies are listed 'Best First'.
Re: Convert Text to HTML Checkbox
by halley (Prior) on May 29, 2003 at 02:08 UTC

    Just mark up your own text: it's not so hard to type <code>$foo->bar()</code> to get those characters to appear like $foo->bar() in the middle of a paragraph.

    Likewise, here's a linebroken example.

    <code>
    $foo->bar();
    </code>

    $foo->bar();
    Inside the CODE tags, those characters appear literally. That's what they're for.

    --
    [ e d @ h a l l e y . c c ]

Re: Convert Text to HTML Checkbox
by arthas (Hermit) on May 29, 2003 at 10:22 UTC
    Even though I wasn't doing everything properly when I began using PerlMonks, I find the HTML & shortcuts textareas are a very powerful way of typing text in.

    After all, it ain't that difficult to just write "<br>" instead of hitting enter key. ;-)

    Michele.
Re: Convert Text to HTML Checkbox (POD)
by tye (Sage) on May 30, 2003 at 04:20 UTC

    I've made changes to make non-HTML display better. For example, I can type $line= <STDIN>; without CODE tags (like I just did there) and it shows up fine. It used to show up as $line= ;.

    I'd like to add a user setting such that "[link]" turns into "[link]" instead of the usual "link". New users would start with this setting turned on so that, if they don't know to use HTML, then their text will still be mostly recognizeable.

    But these changes were mostly to help newbie users of the chatterbox. The feature that is supposed to help newbie posters is: PREVIEW. We even have forced preview now. We probably need to add some more hints to let newbie posters understand that the preview actually works and it is their posting that is broken :) (and other interface improvements).

    Now, I mostly hate <br /> tags. So I don't want a "convert text to HTML" option because I don't want your text paragraphs to preserve their line breaks such that they don't adjust well to the different display/font sizes of different visitors.

    I'd more likely take a hint from POD. I could see detecting blank lines and turning them into <p> automatically (for certain users or if no other HTML mark-up is present or something). And I could see detecting paragraphs with indented lines and putting those into CODE tags automatically (again, only if some test says we have a newbie poster).

    Or I could see a button between "preview" and "submit" that tries to make automatic improvements like those in the above paragraph. How should this button be labeled? "Auto-fix HTML"? It could even replace your HTML with filtered HTML...

    And I think I'd like to teach PM how to wrap text inside of PRE tags.

                    - tye
      >How should this button be >labeled? "Auto-fix HTML"?

      I kind of like the idea of "compile HTML" or "render HTML". It gives the impression that your code will be both executed and tested in the process. But that's just me, and it's kind of facetious.



      “Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.”
      M-J D
Re: Convert Text to HTML Checkbox
by kutsu (Priest) on Jun 01, 2003 at 20:18 UTC

    One of the biggest shocks of using perlmonks was finding that I needed to use HTML. That said I find I like this method better then typing in text, as it gives me a fair range of control, without having to learn anything new. Also, I'm the type who memorizes the keyboard short-cuts, in order to never use the mouse :)

    I never thought of using <code> to type text as is.

    "Pain is weakness leaving the body, I find myself in pain everyday" -me

Re: Convert Text to HTML Checkbox
by Anonymous Monk on Jun 05, 2003 at 13:01 UTC
    i would agree that the target audience can just type in the html, ..
    but in a 'less chars'-kinda way maybe the conversion box isn't such a bad idea...
    it could even automagically do stuff with http:// and user@doains
    on the other hand than you could just as easily build in an <div contenteditable=true> - typof wysiwyg editor...
    or could.....
    *but* then i return to the first point..
    people who prog perl aren't allowed, imho, to complain bout typing html

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-24 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found