Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Obtruding Writeup Formatting Tips

by shmem (Canon)
on Mar 04, 2008 at 15:42 UTC ( #671903=monkdiscuss: print w/ replies, xml ) Need Help??

We have that nice list of READMEs and tips below the entry text box for any node. But still posts arrive which seem to be copy & paste & done.

Maybe the textbox for toplevel nodes should include a line such as

Don't bother me to read [id://17558|Writeup Formatting Tips] and forma +t my post, since I even didn't care to delete this line.

After all, deleting a line is three mouse clicks at most. Do you think that would be a TAGRI: They Aren't Gonna Read It thing, still?

update: slight change to title

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Comment on Obtruding Writeup Formatting Tips
Download Code
Re: Obtruding Writeup Formatting Tips
by moritz (Cardinal) on Mar 04, 2008 at 15:45 UTC
    You could enhance that idea: if the line is still in the post, the "create" button acts exactly like the "preview" button, which means that the post is not displayed.

    (I don't know if that's acceptable, but I'm tired of "no paragraphs, no lines breaks, no code tags" postings that fill a whole display page).

Re: Obtruding Writeup Formatting Tips
by moklevat (Priest) on Mar 04, 2008 at 15:57 UTC
    I like the idea of a default entry, and would suggest the ability to disable it in user settings. I also like the idea that "preview" persists until some specific formatting action is taken. Perhaps this behavior can go away after a suitable level has been attained? As to what level, I now wonder if there incorrigibles who persist with major, obvious, formatting problems beyond, say level 5...or even 4.
      Like moklevat I too like the idea of a default entry, that could be disabled through user settings.
      Perhaps even in the form of a template.
      With predefined sections for the title, question and built in tags for code.
Re: Obtruding Writeup Formatting Tips
by apl (Monsignor) on Mar 04, 2008 at 16:12 UTC
    Wonderful notion. Along similar lines, it seems like I've seen a dozen messages of the form "I've been tearing my hair out over this for the last 12 hours..." or "Perl keyword foo doesn't work!" in the last week.

    Perhaps the default message content could also suggest they ignore SuperSearch and the FAQs? 8-)

Re: Obtruding Writeup Formatting Tips
by ambrus (Abbot) on Mar 04, 2008 at 16:55 UTC

    I oppose this. It would be rude for the newcomers, and possibly confusing as well.

    Also, those suggestions under the writeup box should be brought into a better form than what they are now. I don't really know what they should tell, and whatever it is, there will be people not reading it, but we should think of those who do read it.

      I've occasionally wished the tips included a quick reference to shortcuts, or at least a direct link to that node.
      It would be rude for the newcomers

      You did see the "such as", dinn' ye? It hasn't to be just literally that line.

      But see, running h2xs -AX -n Quux yields the following DESCRIPTION pod

      Stub documentation for Quux, created by h2xs. It looks like the author of the extension was negligent enough to leave the stub unedited. Blah blah blah.

      so I guess a similar default text could pass as "good practice"...

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      I've always said you can get more with a kind word and a two-by-four than you can with just a kind word. – Marcus

      Barging in and dropping an ill-considered pile of poorly formatted question without taking the time to learn the lay of the land would be rude of newcomers, yes. :) If the presence of such a (pointed, or blunt) warning dissuades them before they commit such a gaffe then both the poster and the readers are served.

      Not to mention that the warning properly styled (<span class="lazy_boor">...</span>) would make a handy hook . . . .

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

Re: Obtruding Writeup Formatting Tips
by Old_Gray_Bear (Bishop) on Mar 04, 2008 at 18:19 UTC
    I agree with shmem that a default line or two to prime the pump and point to the formating suggestions would be a Good Idea(tm). I also agree with ambrus that the proposed text is too abrasive. I could get behind something like "If you preview the text and things don't look right, see Writeup Formatting Tips for further suggestions."

    One of the big draws for the Monastery is our collegiality. Even in the middle of an ugly flame-fest, folks are mostly polite and civil to each other (baring the occasional Anonymous Monk, of course). I get enough gratuitous rudeness at work during the course of the day, let's not import Bad Ideas From Outside unless we have absolutely tried anything else.

    ----
    I Go Back to Sleep, Now.

    OGB

Re: Obtruding Writeup Formatting Tips
by GrandFather (Cardinal) on Mar 04, 2008 at 19:55 UTC

    The user settings Signature Settings node already allows a node template to be provided. It wouldn't be hard to default that to some suitable preliminary text along the lines of "Please read Writeup Formatting Tips then delete this line.".

    Icing would be to have PM notice that the template text remains at the start or end of the node and disallow create until it is removed. In that case we should either indicate in Writeup Formatting Tips or in the bullet list how to change the template text.


    Perl is environmentally friendly - it saves trees
Re: Obtruding Writeup Formatting Tips
by holli (Monsignor) on Mar 04, 2008 at 20:33 UTC
    The real WTF is that users still need to use hand written markup at all! It's not as if there were free browser based html editors available.


    holli, /regexed monk/
Re: Obtruding Writeup Formatting Tips
by chromatic (Archbishop) on Mar 04, 2008 at 20:38 UTC

    Several people who know enough about PM to add signatures can't seem to manage not to put the text of their nodes in the signatures, so that people who hide all signatures only see empty nodes.

    Some people will still not preview their posts even with this suggestion.

      I agree, some users are impenetrable. I don't think anything we do will be completely effective.

      The question is, will this make a difference that's worth the effort? If it's an easy change to make, it may be worth the effort even if it makes only a small difference. I hate to say "cost benefit analysis," but that's about what we're doing.

      • How hard is it to make the change? (cost)
      • How much will it improve the posts of ignorant users? (benefit)
      • How much will it annoy other users? (cost)
      • Does it cure cancer? (benefit)
      • Will it destroy the Monastery as we know it? (cost)
      • Etc. (analysis)
Re: Obtruding Writeup Formatting Tips
by plobsing (Friar) on Mar 04, 2008 at 22:58 UTC
    Why not insist that all top level nodes contain some markup. And inform users not using markup that their submission will be rejected until they add some.

    If its just default text, I would be tempted to just cut it without reading it. If I can't post without formatting, I'll be forced to think about formatting (and hopefully use it).

    I doubt many such nodes should really go without any markup whatsoever. And for those that really can, is it that bad to end with <br/> or something to avoid this rule?
      I like that idea, but I think that the current markup is somewhat difficult for beginners.

      What about letting the user chose between the current markup, and none at all?

      In the "no markup" mode line breaks would be preserved, and one might even automatically detect code sections (paragraphs that contain lines that begin with whitespaces, for example).

Re: Obtruding Writeup Formatting Tips
by roboticus (Canon) on Mar 05, 2008 at 13:00 UTC
    How about something like this? For each different top level post type prepopulate the text box with a tiny template that could show posters how to pose their question, with a couple of hints in the text to encourage desired behaviour(s). For example, a new SOPW post might be prepopulated with something like the following:


    I'm having a problem with some function, concept, modeule, etc. I've used Super Search, but didn't find the answer.

    Here's the code I'm having trouble with.
    With "use strict" and "use warnings", I'm getting

    this error message and/or incorrect ouput

    But what I want/expect to see is:

    Correct program results
    The example data that should give those results is:

    Data Data Data
      Then how do we know if they e.g. actually did a super search?
        Hmmmm .... good point. I was thinking that it might prompt them to actually use it, but I can see how it would just make it into too many nodes where it was, in fact, not used.

        ...roboticus

Free Nodelet Hack: a graphical editor for composing nodes
by holli (Monsignor) on Mar 06, 2008 at 20:36 UTC
    This hack "inject" a link directly unter the textarea which, when clicked, will popup a dialog with a graphical Html-Editor.

    There's currently a bug in the support for code tags, it will destroy every br tag within code tags.

    To use this, put the below code in your free nodelet.

    <link rel="stylesheet" type="text/css" href="http://hollihazhomepage.n +et/ext/resources/css/ext-all-mod.css"> <script type="text/javascript" src="http://hollihazhomepage.net/ext/ad +apter/prototype/prototype.js"></script> <script type="text/javascript" src="http://hollihazhomepage.net/ext/ad +apter/prototype/ext-prototype-adapter.js"></script> <script type="text/javascript" src="http://hollihazhomepage.net/ext/ex +t-all-debug.js"></script> <script type="text/javascript" src="http://hollihazhomepage.net/pm/per +lmonks.htmleditor.0.01.js"></script> <script type="text/javascript" src="http://hollihazhomepage.net/pm/per +lmonks.htmleditor.dialog.0.01.js"></script>

    Todo:
    • add button for code-tags
    • add button for readmore-tags
    • add button for spoilers
    • possibilty to integrate in the page instead of dialog
    • add support for links (cpan, wp, etc.)

    holli, /regexed monk/
    <textarea style="width:500px;height:300px;" autocomplete="off" id="html_editor" name="html_editor">

      As of December 26, 2010, the files referenced in the code above seem no longer available, even through the Wayback Machine.

      I note, however, that versions 2.3.0 and 3.3.1 of Ext JS are available through Sencha in an Open Source Version. Prototype is, of course, still located here.

      That only leaves perlmonks.htmleditor.0.01.js and perlmonks.htmleditor.dialog.0.01.js, which I include below (from my personal archive) for future reference:


      perlmonks.htmleditor.0.01.js :

      // initialize quicktips Ext.QuickTips.init(); Ext.namespace('Perlmonks'); Perlmonks.HtmlEditor = Ext.extend( Ext.form.HtmlEditor, { enableAlignments: false, enableLinks: false, enablePMLinks: false, createToolbar : function(editor){ Perlmonks.HtmlEditor.superclass.createToolbar.call(this, edito +r); this.tb.items.item('backcolor').hide(); }, setValue : function(v){ v = v.replace(/\n/g, String.fromCharCode(222)); while ( v.match(/<code>(.+?)<\/code>/i) ) { v = v.replace(/<code>(.+?)<\/code>/ig, escapeCode(RegExp.$ +1)); } while ( v.match(/<c>(.+?)<\/c>/i) ) { v = v.replace(/<c>(.+?)<\/c>/ig, escapeCode(RegExp.$1)); } v = v.replace(new RegExp(String.fromCharCode(222), 'g'), "\n") +; Perlmonks.HtmlEditor.superclass.setValue.call(this, v); }, getValue : function(){ var v = Perlmonks.HtmlEditor.superclass.getValue.call(this); v = v.replace(/\n/g, String.fromCharCode(222)); while ( v.match(/<pre class="code">(.+?)<\/pre>/) ) { v = v.replace(/<pre class="code">(.+?)<\/pre>/g, deEscapeC +ode(RegExp.$1)); } v = v.replace(new RegExp(String.fromCharCode(222), 'g'), "\n") +; return v; }, getDocMarkup : function(){ return '<html><head><style type="text/css">body{border:0;margi +n:0;padding:3px;height:98%;cursor:text;} .code { font-family: Courier +, "Courier New", monospace }</style></head><body></body></html>'; } }); function deEscapeCode (txt) { txt = txt.replace(/&lt;/g, '<'); txt = txt.replace(/&gt;/g, '>'); txt = txt.replace(/<br>/g, "\n"); return String.format("<code>{0}</code>", txt); } function escapeCode (txt) { txt = txt.replace(/</g, '&lt;'); txt = txt.replace(/>/g, '&gt;'); return String.format('<pre class="code">{0}</pre>', txt); } function find_my_ta () { var a = document.getElementsByTagName('textarea'); for (var i=0; i<a.length;i++) { var m = a.item(i).attributes; for (var j=0; j<m.length; j++) { if ( m.item(j).nodeName=="name" && String(m.item(j).nodeVa +lue).match( /(note_doctext|setfreenodelet)/ ) ) { return a.item(i); } } } }

      perlmonks.htmleditor.dialog.0.01.js :

      // find the textare of the current page and add a a link to show the h +tml editor dialog var ta = find_my_ta(); Ext.DomHelper.insertAfter(ta, { tag: 'p', html: '<a href="" id="show_h +tml_edit">html edit</a>' }); // the editor dialog var ed = new Ext.Window({ layout:'fit', width:500, height:300, closeAction:'hide', maximizable: true, plain: true, items: new Perlmonks.HtmlEditor({ id: 'html_editor' }), buttons: new Array ( { text:'Ok', handler: function(){ ta.value = Ext.getCmp('html_editor').getValue(); ed.hide(); } }, { text: 'Cancel', handler: function(){ ed.hide(); } } ) }); ed.on('show', function(){ Ext.getCmp('html_editor').setValue(ta.value); }); Ext.get('show_html_edit').dom.onclick = function (event) { try { ed.show(); } catch (e) { alert(e); } return false; };

      Of course, since time has elapsed between versions of all of the above, tweaking may be needed. YMMV.

      HTH,

      planetscape

        What's the current status of this? Does anyone have it working?

        Thanks...

        I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (14)
As of 2014-08-22 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (159 votes), past polls