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

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
One of my New Year's resolutions is to release more code, even if it doesn't meet my quality expectations yet...

I'm using this hack for some time now...

It's a nodelet hack which automatically transforms my wiki-ish syntax into monk-code on submit.

This is done transparently because after a reload the monk-code in the textarea is translated back to the original wiki syntax.

Please note that you can still safely use and blend PM-markup as long as you use lowercase characters. The automatically transformed code is always uppercase.

The biggest benefit is that paragraphs <P> are automatically included between two newlines...

...but I added some more goodies over the years. (see examples further down.)

To activate this for yourself you just need to include the following code into your free nodelet.

<script src='?abspart=1;displaytype=displaycode;node_id=1153804;part=3'></script>

(UPDATE: Additionally the "Free Nodelet" must be activated at Nodelet Settings)

I hope the mechanism of the code is obvious enough to be adapted to your needs.

---Code---

---Demo---

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

update

codelink corrected, including another codearea changed the index to 3

footnotes

) there is a long To-Do list left, but the idea of open source is to attract collaborators and/or forks ... right? ;-)

bugfixes

  • surrounded activation of JS events with if(textarea) { ... } to avoid pages without posting forms (like RAT)

In reply to Good Intentions: Wikisyntax for the Monastery by LanX

Title:
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 the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (4)
    As of 2020-08-14 15:32 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Which rocket would you take to Mars?










      Results (76 votes). Check out past polls.

      Notices?