Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Functionality to automatically insert <readmore> tags into long posts?

by OfficeLinebacker (Chaplain)
on Jul 05, 2013 at 19:20 UTC ( #1042770=monkdiscuss: print w/ replies, xml ) Need Help??

So I discussed this in the CB. At first I advocated for some sitewide setting. After hearing a lot of opinion that it should be up to the user, perhaps this is a setting that could be enabled (disabled?) at the user setting?

How about a setting that automatically puts a readmore tag X lines into a post if it's more than say Y lines long? Perhaps a good initial setting for X and Y would be 10 and 20?

What do you think?

Comment on Functionality to automatically insert <readmore> tags into long posts?
Re: Functionality to automatically insert <readmore> tags into long posts?
by Loops (Curate) on Jul 05, 2013 at 19:26 UTC

    As you mentioned in the CB discussion, existing tags will have to be respected. <readmore> can't be inserted in the middle of a <code> block for example. Also, nothing automatic should happen if the submitter includes appropriate <readmore> tags on their own initiative. This way if the automation gets it wrong, the submitter can go back and place the tags more appropriately.

      Should be fairly simple to parse the post for existing readmore tags before inserting some automatically.
Re: Functionality to automatically insert <readmore> tags into long posts?
by LanX (Canon) on Jul 05, 2013 at 19:37 UTC
    > What do you think?

    I can think of many automation things which might make sense.

    Automatic paragraphs or a heuristics to sense and warn unmarked code for instance¹.

    But the decision is of an economic nature, does it save more work than it causes?

    The amount of considerations mentioning "readmore" or "code" might be in indicator...

    OTOH there are certainly many features here in the settings whose profit/maintenance factor is far to small.

    Anyway if you personally want this readmore feature, using a nodelet-hack should easily do it for you.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

    ¹) "did you forget code-tags?"

      This feature wouldn't be a huge improvement or anything, just help alleviate one small annoyance. So in that sense it's hard to justify much investment in it. However, it does affect all visitors many/most of whom wont employ a nodelet-hack and will thus have slightly less positive experience.

        maybe a misunderstanding, a nodelet hack to fold long posts of other monks, not one that includes <readmore> tags into your own replies.

        Cheers Rolf

        ( addicted to the Perl Programming Language)

Re: Functionality to automatically insert <readmore> tags into long posts?
by 2teez (Priest) on Jul 05, 2013 at 20:09 UTC

    Hi OfficeLinebacker,
    What do you think?
    In as much as automation of "any" form could be see as a "cool" feature depending on who and what. I think people should be responsible to a large extent for what and how their post is.
    Of course, one could argue that automation for <code> tag should be done so that, once a line as such as #!/usr/bin/perl or use warnings; use strict; is seen then a code tag should be applya. If so, where then is the "free-will" and the real "freedom".
    Make a tool available to people and show them how to use it, is way of better than doing it for them.
    Mine thought!

    a I prefer people putting their codes in code tags though!!!

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me
      I think it's kind of funny to make "use warnings/use strict" be the marker for code! Isn't one of the most given pieces of advice on here "you should use strict!!"?

        'Isn't one of the most given pieces of advice on here "you should use strict!!"?'

        Sadly I don't think so ;) Regardless, it doesn't make sense to have this as a marker for code tags, as a lot of posts contain short self contained snippets rather than full programs.

Re: Functionality to automatically insert <readmore> tags into long posts?
by ww (Bishop) on Jul 05, 2013 at 23:37 UTC

    Nice of you to volunteer to code this 'enhancement' so the Monks can evaluate it.


    If you didn't program your executable by toggling in binary, it wasn't really programming!

Re: Functionality to automatically insert <readmore> tags into long posts? (naturally)
by Anonymous Monk on Jul 06, 2013 at 03:01 UTC
Re: Functionality to automatically insert <readmore> tags into long posts?
by rjt (Deacon) on Jul 06, 2013 at 12:22 UTC

    ++ for the following reasons:

    • Better usability for people reading the Monastery (including those without accounts, if a sensible default is chosen).
    • Less tax on moderators to consider nodes for addition of <readmore> tags.
    • Puts the subjective judgement of "how long is too long" on the person affected by the length: the reader. In other words, where should the poster place <readmore> tags to simultaneously cater to monks who each prefer a different length?
    • Development and maintenance would likely be rather small compared to the benefit.
Re: Functionality to automatically insert <readmore> tags into long posts?
by sundialsvc4 (Abbot) on Jul 23, 2013 at 14:50 UTC

    Some forum-engines handle this sort of thing automagically on-display.   If the post is longer than a certain size, it stops at a certain point with a clickable tag ... which reveals the rest by means of a little JavaScript snippet that un-hides the HTML section.   It would be easy to do.   But is it actually worth doing?   I’m not sure.   I guess I’m too comfortable now with this ol’ familiar dog ... and reluctant to do things with other people’s content, as they say, “automagically.”

      I already thought of this, but it's only possible with linear text without nested html structures.

      For instance you can't easily break a code-section just somewhere in the middle.

      In consequence we are back to the original problem, namely to parse the doc-tree of the post and to decide where to automagically put readmore-tags around.

      I thinks it's easier just to count the lines and to force the poster to include <readmore> tags.

      OTOH since I'm not motivated to code it, I don't ask others to do it.

      Cheers Rolf

      ( addicted to the Perl Programming Language)

        I already thought of this, but it's only possible with linear text without nested html structures.

        Huh? I think you're over thinking this, its 100% javascript

        $("tr[@class='reply-body pmnote-708738']/td[@class='reply-body']").hei +ght(200);

        Add a show/hide from one of these Re: Collapsible comments, toggleDisplay

Re: Functionality to automatically insert <readmore> tags into long posts?
by tinita (Parson) on Jul 24, 2013 at 09:59 UTC
    my forum software just tells the user that the posting is too long and suggests to use more-tags (and subtracts already used more-tags from the size of the posting). otherwise it prevents the user from posting.
    this is the easier part; automatic insertion of such tags would be more complicated.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2014-12-21 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (100 votes), past polls