Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Perl Monks Discussion

( #1040=superdoc: print w/replies, xml ) Need Help??

This section is only for discussing issues pertaining to the PerlMonks web site. You can ask about how things work, or offer ideas on how the site could be improved, for example.

Unless the topic pertains to the PerlMonks web site, it does not belong in this section. If you're unsure, check out Where should I post X? and The Perl Monks Guide to the Monastery, or ask in the chatterbox.

PerlMonks Discussions
Tests for PM code?
2 direct replies — Read more / Contribute
by LanX
on Nov 18, 2017 at 12:02
    Hi

    this might be of general interest, so I'm not posting it in the Inner Scriptorium

    I think I have identified the code which renders markup in the monastery ParseLinksInContent

    But ...

    • Where are the tests?
    • Are there special node types used to test code nodes?
    • How are pmdev supposed to test new code?

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

Newest Nodes: Notes: Skipping huge list of notes
2 direct replies — Read more / Contribute
by beech
on Nov 14, 2017 at 03:58

    Hi,

    So this is what I see on Newest Nodes under Notes

    Skipping huge list of notes

    I have a better idea , trim the list so its huge-1 :) its better than skipping

    Thanks

    update: I approve this node under Perl Monks Discussion :)

TOC draft sample
3 direct replies — Read more / Contribute
by ww
on Nov 07, 2017 at 08:14

    Draft, sample revision of Markup in the Monastery per LanX's excellent suggestion that we include TOC's in at least some informational nodes. Thanks LanX!
    Comments, please, from all (and see Re: TOCs and deeplinks for our house rules for background/my comments).

    Update/edit: per suggestions in replies from LanX and pryrt, some chapter titles in the body of the doc have been changed to more closely match the TOC entries.

    Markup in the Monastery

    Contents:

    Chapter 1 - Basics: Para & Code markup

    There are just two basic markup elements you MUST use when posting a comment or question:

    <p>...</p> Paragraph tags, so the narrative part of your node won't be an unreadable mismash.

    ...and

    <c>...</c> Code tags around code and data (which can be cut and pasted direct from your editor).

    And now you know those, you can go back to creating your node unless you'd like to learn more.

    Chapter 2 Additional Markup (Overview+Examples)

    Here's a synopsis of important tags and their actions:

    Your PostPM Markup:Result:
    Paragraphs
    <p>first paragraph</p>
    <p>second paragraph</p>
    

    first paragraph

    second paragraph

    Code
    <p>The result is in <c>$array[0]</c></p>
    

    The result is in $array[0]

    <c>
    use strict;
    use warnings;
    
    my @array = ("Hello world\n");
    if (@ARGV) {
        print $array[0];
    }
    </c>
    
    use strict; use warnings; my @array = ("Hello world\n";); if (@ARGV) { print $array[0]; } #
    Note: The "download" link is automatically displayed on <c>...</c> blocks. It links to a raw display of the displayed code. You don't need to do anything to enable this link.
    link to PM nodes by name
    
    Have you tried [Super Search]?
    
    Have you tried Super Search?
    Thanks for your help, [tye]
    Thanks for your help, tye
    Thanks for nothing, [tye|wiseguy]
    
    Thanks for nothing, wiseguy
    Link to PM nodes by ID
    Please consult [id://3989]
    
    Please consult Super Search
    External Links
    Did you try [http://www.activestate.com/]?
    
    Did you try http://www.activestate.com/?
    Other kinds of links
    (more info)
    Check out [pad://NodeReaper]
    
    Check out NodeReaper's scratchpad
    Did you check [doc://perlfaq]?
    
    Did you check perlfaq?
    text/font formatting
    This will be <b>bold</b>
    
    This will be bold
    This will be <i>italic</i>
    
    This will be italic
    This will be <tt>fixed width</tt>
    
    This will be fixed width
    Blockquotes (indented)
    A wise monk once said:
    <blockquote>
    "Indenting is good"
    </blockquote>
    .. and I agree
    
    A wise monk once said:
    "Indenting is good"
    .. and I agree
    Lists
    My favorite flavors are:
    <ul>
    <li>vanilla</li>
    <li>chocolate</li>
    </ul>
    
    My favorite flavors are:
    • vanilla
    • chocolate
    How to make toast:
    <ol>
    <li>insert bread</li>
    <li>press button</li>
    </ol>
    
    How to make toast:
    1. insert bread
    2. press button

    Chapter 3 - Warnings & Tips

    PM markup code is NOT entirely w3c html 4.01 standard nor is it XHTML, so even if you're expert please scan these notes.

    Textual content:

    Ordinary paragraphing is accomplished with <p>...</p> tags, which (imprecisely) allow you to have your text appear in what may be called "conventional" paragraphs; that is with blank lines between paragraphs. That's highly recommended, as it makes your node easier to read.

    Links: Please, do NOT use <a href="http://example.com">something</a>. Instead, create links (especially those to nodes at PM) using [...] The ... inside the square brackets may be a node's title or its id://(number). Optionally, you can override the target's title with your chosen alternate by adding |(some word or phrase) after the id or title before closing the square brackets.

    For example, [Super Search|Did you try to find that here?] will render as Did you try to find that here?. More extensive and sophisticated information can be found in What shortcuts can I use for linking to other information?.

    Lists: lists can be either ordered (decimal numbered - using Roman numerals or letters is beyond the scope of this note) or unordered (bulleted). One of each follows; first the ordered list, created with this:

    <ol><li>line 1 of list</li><li>line 2 of list</li><li>and so on</li><ol>

    1. line 1 of list
    2. line 2 of list
    3. and so on

    The unordered list uses <ul>...</ul> around the list item <li>...</li> tags:

    • line 1 of list
    • line 2 of list
    • and so on

    <b>...</b> can be used to enclose words, phrases or sentences you want to have appear in boldface. As a courtesy, do NOT abuse this... and use the preview function to check. Similarly, <i>...</i> can be used to italicize content.

    <tt>...</tt> tags surrounding a word or phrase (commonly, a single key word or symbol) cause that word or phrase to be rendered in something akin to a system font; eg: key words within the surrounding text.

    Heading tags, <h3>...</h3>, and smaller (through <h6>) may be used. Head tags, unsurprisingly, cause their content to render as headlines. For example

    <h4>A headline<h4>

    <h6>A smaller headline</h6>

    Any <hn> ... </hn> tag pair can be thought of as implying line breaks above and below (absent manipulation with css or other techniques far beyond the scope of this node). Please note that <h1> and <h2>are discouraged here.

    <blockquote>...<blockquote> is used to indent a (brief, please) segment of your text and works like this (the fixed width pseudo-tags, below, illustrate the actual useage):

    <blockquote>This is a blockquote. Note that it is indented both left and right and offset top and bottom by a blank line. This blockquote rambles on to ensure that regardless of the width of the viewer's browser window, there are multiple lines inside the blockquote. Note that there are no paragraph tags around this paragraph although using them would be allowed...and that it is permissible to include, for example, <b>textual</b> <i>markup
    </i><c> inside the blockquote. <p><c><p>
    What's more a blockquote can include multiple paragraphs. Again, this is padded with enough non-substantive verbiage to make it wrap in most user's browser windows.</p></blockquote>

    If you find it necessary (and you should make every effort to ensure it is NOT) to create a very long post, please use <readmore> ... </readmore tags. Should your post make it to the front page, the readmore segment collapses to a link by which the interested reader can see the entire post.

    Puzzle answers aka spoilers

    If you post a puzzle, enclose the answer in <spoiler></spoiler> tags, so you don't spoil the puzzle fun for others.

    Detail: <spoiler>...</spoiler> tags are intended to (temporarily) redact (in the intel world's sense; "black out") some brief piece of text or code whose visibility would spoil a thread for some future reader. Example:

    In a simple case, the material inside the spoiler tags will become visible when highlighted; the general idea being that a little more work is required to see the content than simply viewing a node.
    The reader's preference settings may cause <spoiler> tags to be rendered in unexpected ways.  Note that when wrapped in <c><code> tags the </c></c> tags will be treated as literal text.

    Nesting: Check for proper nesting. For example, if you open a paragraph tag, close it before beginning a blockquote or code segment. And that leads us directly to the next important pair of tags.

    Code:

    Use code tags, <c>..</c> (or <code>...</code>), to post code and data. Doing so preserves your indentation, blank lines and those symbols for which use of character-entities is conventional elsewhere. Char-entities are discussed further, below

    A typical use would be to cut'n'paste your code into a PM node Code tags cause the code (or data) they enclose to appear in a distinguishable font. If you have turned on line-numbering in the section on "Code Listing Setings" in Display Settings the code lines will be numbered. The following is inside <c>...</c> tags.

    #!/usr/bin/perl use warnings; use strict; use (some module); if (some condition) { do something; and something more; # with a comment to make this a very, very lon +g line which will wrap in many browser windows, absent a gigundo moni +tor and so on. If you don't have auto code wrap on in "code," you'll +see a red plus sign and a lack of line number on the continuations af +ter wrapping is performed (sometimes at unfortunate points, as can be + seen in this instance, if you don't have auto code wrap turned on. } else { &whatever; # Note below } sub whatever { do something; }

    Note the download link, above. It appears after each stand-alone code block and allows readers to retrieve the code or data, without the line numbers.

    Note that in line 11 the "&" did NOT have to be written as a character entity (&amp;). If you're not seeing line numbering, see that setting in Display Settings.

    <pre> vs. <code>

    At first blush, the <pre> ...</pre> pair may look like an alternative to code tags... BUT DON'T USE IT HERE chiefly because <pre>...</pre> tags will not persuade the Monastery to provide a download link for the contents of the <pre>... and while it is now supposed to wrap lines that are too long for the viewer's browser window, there are ways Monks could use CSS that would defeat that. So, please. don't use <pre>...</pre> except to deal with exceptional cases... like that in the next paragraph (which still needs examples of using pre inside a long stretch of code).

    Exception: non-ASCII characters inside the ... may magically display as unrendered entities (i.e., as question-marks) instead of the character you expected, whereas inside <pre> ...</pre>, they may work as expected. (Thanks, pryrt).

    More untoward or problematic markup

    Inserting a <br> tag forces a newline at the point at which it's inserted. Monastery documents differ on its acceptability but in the form in this sentence, it generally works... while alternates, like XHTML's <br /> do NOT work.

    Using <div>...</div> tags is NOT deprecated, but unless you're expert in .html, you probably shouldn't use them here.

    <font (something="something")>... </font> tags are frowned upon. Don't use them except in extraordinary circumstances.

    Character Entities

    Please read carefully the hints which appear below the text entry box when you're creating a node. Outside code tags

    For: Use:
    &  &amp;
    <  &lt;
    >  &gt;
    [  &#91;
    ]  &#93;
     &trade;
    ®  &reg;
    ©  &copy;
     &mdash;

    Appendix

    If you are a logged-in user, you have Display Settings which you can check or change. See particularly the section HTML Related Options. It is highly recommended that you check the checkbox and set the two other options to their maximum values (3 and 4, respectively). These will tell you quite clearly when you omit a required tag, and will help when you bork tag nesting rules.

    Most of the tags discussed above should be used in pairs (that is, <tag>... </tag>. While some of the other tags addressed in this node will DWIM even if you fail to close them, the <b>, <i>, and <tt> tags will not, nor will some "block level" tags like <ol>.

    A table listing all PM-approved html and arguments is available for those who wish to delve deeper.

    Beware of using your browser's "view page source" feature to see how a writeup has been formatted. Not only are you viewing a node after it has been processed by PerlMonks (turning What shortcuts can I use for linking to other information? into actual links, for example), but many browsers do additional processing on received pages, such as inserting missing closing tags.

    In the interest of brevity and simplicity, some statements above are oversimplified... and some do NOT apply to the CB, for which see PerlMonks Approved Chatter HTML Tags.

    ...and finally

    None of this will be much help if your content is unclear. Use an explanatory title, standard spelling, grammar, and punctuation. If posting a question, explain exactly what your problem is (and include warnings and error messages, verbatim, if received). Tell us what your input is in a separate code block or as a <DATA> section at the end of your code. Be explicit about the expected output, unless that's utterly unambiguous, and tell us how what you're getting, if anything, deviates from your expectations or desires.

    How do I post a question effectively?, Before You Post ... and On asking for help address many valuable points. If you're new to the Monastery, you'll profit greatly — EVEN IF YOU'RE IN A RUSH TO GET AN ANSWER — by reading these. And, oh yes, remember, "Your 'urgent need' is not our emergency."


    Back to the PerlMonks FAQ.

    As noted above, please comment here or address comments to ww.

Lightweight interface to cast votes?
5 direct replies — Read more / Contribute
by LanX
on Nov 04, 2017 at 10:18
    Hi

    I wanted to address the problem that we need to scroll down in order to click the vote button, which is annoying when reading longer sub-threads.

    (At least when using a mobile I can't just hit return to submit)

    I can think of a nodelet hack injecting buttons which does am AJAX request and updates the result.

    Problem is that this would cause unnecessary overhead because the whole page is returned.

    I was browsing thru our XML generators but couldn't find any mention of a light weight interface.

    Am I missing something?

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

    updated

    improved wording, added emphasize

TOCs and deeplinks for our house rules
3 direct replies — Read more / Contribute
by LanX
on Oct 31, 2017 at 14:17
Perl News: Approval Nodelet missing options
1 direct reply — Read more / Contribute
by kcott
on Oct 29, 2017 at 08:26

    I just noticed "Get Title ip's list browser" posted in Perl News. I've considered it to be moved to SoPW.

    Normally I could have performed this myself (e.g. PMD -> SoPW); however, this wasn't the case here: there's no option for doing this in the "Approval Nodelet".

    I have noticed in the past that posts to "Perl News" have no Approve/FrontPage options in the "Approval Nodelet" either.

    If this is intentional, could someone explain why; if an oversight; could this be rectified (or, at least, put on a TODO list).

    — Ken

Cannot simultaneously approve and consider a post, nor approve it after considering
1 direct reply — Read more / Contribute
by 1nickt
on Oct 12, 2017 at 14:32

    Hi all, I noticed that the form allows you to select both checkboxes, for approval and consideration. This is useful for example when a post is approvable but has a typo in the title.

    When you do this, the post is *not* approved but *is* considered.

    After you do this operation and consider the post, you cannot then later approve it.

    This is a drag because (a) if you don't know about it, the post becomes considered and unapproved, and (b) if you do know and remember, it takes two form submissions to do what should be one combined op.


    The way forward always starts with a minimal test.
Can I get emails when somebody responds to my PerlMonks post?
3 direct replies — Read more / Contribute
by BeneSphinx
on Oct 04, 2017 at 19:13

    I have been looking for some option to get an email when somebody replies to my post, but I cannot find one. Is there one?

Missing "Vote" button
3 direct replies — Read more / Contribute
by syphilis
on Sep 30, 2017 at 23:23
    Hi,
    The "++" and "--" selections for the individual posts are enabled, but there's no "Vote" button that I can see at csv2png.pl - Line Graphs from a CSV file.
    Who took it ?

    In other threads that I've just checked, the "Vote" button is in the usual place.

    Cheers,
    Rob

    2017-10-01 Athanasius made link relative

Node ID Typos in Considerations
3 direct replies — Read more / Contribute
by kcott
on Sep 20, 2017 at 05:51

    There appear to be what I'll assume are typos in two considerations.

    The nodes in question are:

    #1199646 was considered for reaping as a dupe of itself. I suspect that should have been "a dupe of #1199658" (although that one was posted about three hours later). Anyway, as you can see above, #1199646 has been reaped: unless there's some administrative reason to change the consideration text, there's probably nothing more to be done about that.

    I replied to #1199646 (Re: Splitting a file based on matched conditions). My post has been considered for reparenting to #1199646 (its original and current parent). That consideration should also have probably referenced #1199658 for the new parent. I have no problem with the reparenting; however, as it stands, the consideration is confusing: maybe a quick s/46/58/ to fix.

    — Ken

How to get raw node content
2 direct replies — Read more / Contribute
by roboticus
on Sep 15, 2017 at 14:25

    Hello, gang:

    I was wondering if there was an API available that would let me fetch the raw content of a perlmonks node?

    Every once in a while, I see a node that I'm interested in dismantling, but it gets a bit butchered by the HTMLification/templating/(or something). The latest example is Reaped: Re: .pl to .exe, where I'm wanting to figure out just what the code is doing. But with the HTML entities, font rendering and whatnot, I can't really tell exactly what the code *was*. So rather than hand-editing it and trying to put it in a form that I can analyze, I'd love to be able to occasionally fetch just the raw node contents.

    I did a little googling and trying to browse the SiteDocClan nodes, but I'm not a member, so there's a limit to what I can see (e.g., I can't see sdc to-do wiki, SDC Wiki, the PMDev, editor, cabalist and pedagogue wikis...).

    I've found some public information, like What XML generators are currently available on PerlMonks?, WWW::PerlMonks, but I didn't see anything that provides the raw node content. I'm not asking for a new feature if it's not available, just a pointer to it if it exists.

    Thanks!

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Chronological Ordering of Nodes with the Same Timestamp
4 direct replies — Read more / Contribute
by kcott
on Sep 12, 2017 at 03:27

    In "Tk label width to fit in text area", when viewed as "Replies are listed 'Oldest First'.", there are two nodes, listed in the following order, with these title bars:

    Re: TK LABEL WIDTH TO FIT IN TEXT AREA [id://1199162] by Anonymous Monk on Sep 12, 2017 at 14:35 AEST ... Re: TK LABEL WIDTH TO FIT IN TEXT AREA [id://1199161] by Anonymous Monk on Sep 12, 2017 at 14:35 AEST ...

    Everything about these two nodes is identical except for the node IDs. [In fact, #1199162 had been considered for reaping because it's a duplicate: that may have happened by the time you read this.]

    Anyway, on the basis that #1199161 was created before #1199162, #1199161 should be displayed first, i.e. the current order reversed.

    As I've no idea of the code behind this, I can really only guess, but perhaps where the timestamps are identical, something akin to this could be added to the current sort functionality:

    ... || $a->{node_id} <=> $b->{node_id}

    — Ken

CSS in Display Setting Suddenly Not Working
2 direct replies — Read more / Contribute
by wjw
on Aug 27, 2017 at 15:48

    Just putting this out there to see if anyone else has experienced this. Anyone?

    UPDATE: I apologize for not putting more effort or detail in this. (In my defense, I was pretty ill and not thinking very clearly... yes, that is my poor excuse) I was using my Windows laptop which I seldom do, and did not bother to fire up the Linux laptop that I normally use on a daily basis.

    Wrong!This turns out to be a browser issue on the Windows laptop. I am still not clear what the issue is and need to explore a bit more. Following is as far as my foggy head has let me get:

    (To be clear: This is not a huge issue, just an observation, and I am still foggy from the meds, so I hope I got this edit formatted fairly decently) Thank you to those who bothered to respond!

    YourMother is correct. A/some .css and .js file(s) are no longer available from buzzfeed.org.uk, it seems the site is down...

    UPDATE2: Appears that buzzword.org.uk is back on line.... for anyone that cares...

    ...the majority is always wrong, and always the last to know about it...

    A solution is nothing more than a clearly stated problem...

Nodes to Consider: Incorrect Reply Count
3 direct replies — Read more / Contribute
by kcott
on Aug 15, 2017 at 00:18
Too soon for guesses on when node #1234567 will arrive?
7 direct replies — Read more / Contribute
by talexb
on Aug 08, 2017 at 13:31

    So we zoomed past the one millionth node a while back .. and since we're at about 1.19MM, the next obvious milestone is node number 1,234,567. Guesses, anyone?

    Alex / talexb / Toronto

    Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.


Discussion Item
Title:
Give us your input:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":


  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (3)
    As of 2017-11-25 12:15 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      In order to be able to say "I know Perl", you must have:













      Results (355 votes). Check out past polls.

      Notices?