Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-03-28 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found