Re: Good Intentions: Wikisyntax for the Monastery
by Discipulus (Canon) on Jan 28, 2016 at 09:13 UTC
|
Wow! thanks!
I'll try it as soon as i can. for the code part i can't offer help but you'have my user's feedback
L*
UPDATE: it works like a charm, To use it you have to:
-
As said in the OP: To activate this for yourself you just need to include the following code into your Free Nodelet Settings.
<script src='?abspart=1;displaytype=displaycode;node_id=1153804;part=3'></script>
- Go to Nodelet Settings and put the two Free Nodelet to something non zero
LanX it does not work for nested tags? <li>Go to [id://25185] and put the two *Free Nodelet* to something non zero</li>
shows:
2. Go to Nodelet Settings and put the two *Free Nodelet* to something
+non zero
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
> LanX it does not work for nested tags?
It does , but currently only for one word. (see the regex singleword in the code)
The problem are longer strings, the number of misinterpretations will occur far more often if one allows more than 1 word. Where do I have to draw the line? 3, 4 words ...?
I was thinking of using doubled symbols like ** instead of * for longer passages, like in wikicreole.²
The goal is to make the syntax rules customizable for the user.²
In the end <b><i><u> are not really that important, the other features are far more relevant when typing on a mobile device.
update
Thanks for your interest and contribution! :)
footnotes
²) did I mention my to-do list ? ;-)
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
'ARGV'<br>
seems not to behave correctly: just to add to todo list
your code is in production for me anyway
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
| [reply] [Watch: Dir/Any] [d/l] |
|
Re: Good Intentions: Wikisyntax for the Monastery (ToDo)
by LanX (Saint) on Jan 28, 2016 at 14:55 UTC
|
Todos in the pipline / wishlist
General
- cleaner code to avoid namespace pollution
- create Perl version which is auto-translated to JS-version
- auto create documentation of syntax
- test suite also checking browsers
- move to git-hub
- allow individual customizing of allowed features and used markup
- allow caching of imported JS to spare band width
- general JS-Extension framework to encourage more contributions, see also older discussion
More Features
- DONE auto link URLs starting with http://
- DONE parse for internal url's and create [id://...] links (thus avoiding logouts)
- map doc-links of operators to correct perldoc, like ?and? to [doc://perlop|and]
- support for abbreviation list, i.e. auto linking autolinking SOPW or CPAN with mouseover (' title' -attribute) description
- better support for quotes from commented post
- onchange preview with JS of resulting post
- looks-like-code() heuristic to warn about perlcode outside code-blocks
- move [ ]wiki? checkbox under textarea, show only if any submit button available
- include timestamp after updates
- DONE support for deeplinks in perldocs (jump to right chapter)
- better support for cut&paste from perldoc (web or console)
... to be continued...
Requested
- Wiki support for CB
- look behind assertion in around_words
- treat punctuation like whitespace
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
| [reply] [Watch: Dir/Any] |
|
Yeah I know I got used to adding a space before the first line and after the last.
I already mentioned that problem, but ...
... I did'nt want to expand the regexes to other whitespaces for that ATM because that's a PITA to test in different browsers.
It might become configurable in the future, but without guaranty whatsoever.
Anyway the "bold/italic/underline formatting" isn't that important for me, being able to avoid <p> while typing in my mobile is already worth it. ;-)
Naming this PM extension a "wiki" might be a misnomer/marketing error though... ;-)
| [reply] [Watch: Dir/Any] [d/l] |
|
> If it's an empty line, that line disappears after previewing,
this certainly looks like a bug, THANK YOU! :)
UPDATE
So it's not my wiki code causing it.
I tested as anomonk and the content of the textarea is trimmed from surrounding newlines.
maybe it's the monasteries codebase ... maybe a firefox thing.
for the time being, please use an extra whitespace.
| [reply] [Watch: Dir/Any] |
|
First word works now, also does the last
| [reply] [Watch: Dir/Any] |
|
| [reply] [Watch: Dir/Any] |
|
| [reply] [Watch: Dir/Any] [d/l] |
|
| [reply] [Watch: Dir/Any] |
|
To be able to switch the wiki transformation manually on or off.
It could be better placed below the textarea, but this was already mentioned in the todo list.
NB : it's not in the CB but in the Free Nodelet.
| [reply] [Watch: Dir/Any] |
Re: Good Intentions: Wikisyntax for the Monastery (New Features)
by LanX (Saint) on Feb 02, 2016 at 00:10 UTC
|
New Features:
emphasizer B U I span extended
Now one line instead of one word
Link activation
Pasted URLs are automatically linked,
http://www.google.com
=> [HTTP://www.google.com]
== http://www.google.com
http://perldoc.perl.org/perlsyn.html#Loop-Control
=> [HTTP://perldoc.perl.org/perlsyn.html#Loop-Control|perlsyn#Loop-Control]
== perlsyn#Loop-Control
http://www.perlmonks.org/?node_id=708738
=> [ID://708738]
== LanX
http://www.perlmonks.org/?node_id=708738|test
=> [ID://708738|test]
== test
Version data included (hidden)
<!-- wiki2monks JSON-DATA --> is inserted at end of post
Avoid wikification
<nowiki></nowiki> tags
List items (under construction)
- one
- two
- three
+ one
- two
- three
- one
- two
- three
update 2016-02-12
added optional index.pl to regex for PM URLs
http://www.perlmonks.org/index.pl?node_id=708738
=> [ID://708738]
== LanX
| [reply] [Watch: Dir/Any] [d/l] [select] |
Re: Good Intentions: Wikisyntax for the Monastery
by Discipulus (Canon) on Feb 12, 2016 at 09:03 UTC
|
Ok before i forget this: it seems that three code elements in a row are not displaying correctly.
For example
'one' 'two' 'three'
is displayed as one 'two' three
I was also wondering if you can add punctuation ( .,:;)(!? ) as boundary in addition to withespace.
I'm using your wiki syntax in every post. thanks
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
Hi
Thanks for feedback! =)
regarding code sections:
Problem is that JS has no lookbehind assertion for regex.
In order to keep it simple and compatible I'm grabbing the surrounding white spaces too.
If you separate your code by more then one whitespace it works again.
'one' 'two' 'three'
one two three
please note how HTML ignores multiple whitespace.
(This is a very contrived example anyway don't you think? ;)
I could solve this with at least one look ahead assertion, though I'm not sure about incompatibilities. (on todo list now)
Please keep in mind that you can still use the old and consistent markup.
The wiki stuff is more a mix of DWIM and Huffman coding, not a complete replacement. =)
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
> I was also wondering if you can add punctuation ( .,:;)(!? ) as boundary in addition to withespace.
Yes I was thinking about this, but than we need a new mark up for doc links
?print? print
Suggestions?
update
But please be aware that the problem with look around assertions strikes here again.
I have no problem with coding this, but testing would be a pain. ..
| [reply] [Watch: Dir/Any] [d/l] |
|
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
|
|
Re: Good Intentions: Wikisyntax for the Monastery
by FreeBeerReekingMonk (Deacon) on Jan 29, 2016 at 22:33 UTC
|
Just here to say that I find wiki syntax fantastic and this is *GREAT* | [reply] [Watch: Dir/Any] |
|
Thank you ! :)
So you are using it?
(except of this post ;)
| [reply] [Watch: Dir/Any] |
|
I try to, but I did not post much. (update: yay! working now)
| [reply] [Watch: Dir/Any] |
Re: Good Intentions: Wikisyntax for the Monastery (https)
by LanX (Saint) on Jun 22, 2018 at 18:00 UTC
|
Added (long overdue) support for https when autolinking
This
- https://perldoc.perl.org/perldiag.html
- http://perldoc.perl.org/perldiag.html
- https://perldoc.perl.org/perldiag.html#DESCRIPTION
- http://perldoc.perl.org/perldiag.html#DESCRIPTION
- https://www.zeit.de/sport/2018-06/wm-2018-fussball-liveticker#/live
- http://www.zeit.de/sport/2018-06/wm-2018-fussball-liveticker#/live
- https://www.perlmonks.org/?node_id=708738
- http://www.perlmonks.org/?node_id=708738
transforms to
- [HTTPs://perldoc.perl.org/perldiag.html|perldiag]
- [HTTP://perldoc.perl.org/perldiag.html|perldiag]
- [HTTPs://perldoc.perl.org/perldiag.html#DESCRIPTION|perldiag#DESCRIP
+TION]
- [HTTP://perldoc.perl.org/perldiag.html#DESCRIPTION|perldiag#DESCRIPT
+ION]
- [HTTPs://www.zeit.de/sport/2018-06/wm-2018-fussball-liveticker#/live
+]
- [HTTP://www.zeit.de/sport/2018-06/wm-2018-fussball-liveticker#/live]
- [ID://708738]
- [ID://708738]
and shows as
| [reply] [Watch: Dir/Any] [d/l] [select] |
Re: Good Intentions: Wikisyntax for the Monastery
by LanX (Saint) on Feb 08, 2020 at 00:15 UTC
|
<nowiki>
=== headline1
</nowiki>
=== headline2
--> renders now as
=== headline1
headline2
| [reply] [Watch: Dir/Any] [d/l] [select] |
Re: Good Intentions: Wikisyntax for the Monastery
by choroba (Cardinal) on Oct 18, 2016 at 10:19 UTC
|
<c>
perl -we 'say'
</c>
<pre>
perl -we 'say'
</pre>
Update: rendered as
perl -we 'say'
perl -we say
See? No single quotes in the last line!
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord
}map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
<pre>
*a* /b/
# 2 newlines following
https://perlmonks.org/
</pre>
displays now as
*a* /b/
# 2 newlines following
https://perlmonks.org/
update
<blockquote> are now also excluded, but that's experimental.
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
Rather a feature request, don't you think?
Why should pre tags be handled like code tags? °
AFAIR do pre tags never block any other expansion, I wouldn't know why they should.
Could you please elaborate?
Edit:
Please think about how
<pre>a
<code>bla</code>
b</pre>
is rendered
a
bla
b
and tell me why the behavior should be different now.
update Feb 07 2020
°) OK paragraph is a reason, see Re^2: Good Intentions: Wikisyntax for the Monastery (pre-blocks excluded now) | [reply] [Watch: Dir/Any] [d/l] [select] |
|
<nowiki> <pre>
perl -we 'say'
</pre> </nowiki>
<nowiki>
perl -we 'say'
</nowiki>
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
Wrap it in <!-- ... -->?
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord
}map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
Re: Good Intentions: Wikisyntax for the Monastery (issue: "writeln wiki-toggle")
by LanX (Saint) on Feb 13, 2020 at 00:37 UTC
|
I'm experiencing a new issue in Firefox.
The generated HTML tags in the textarea are not translated back to wiki syntax when onLoad fires.
A look into the console logs reveals that
"A call to document.write() from an asynchronously-loaded external script was ignored".
This originates from the creation of the checkbox to switch wikiparser on/off.
I will try to bypass that...
| [reply] [Watch: Dir/Any] |
|
V1.16.0
I deactivated the document.writeln into the "Free Nodelet" and replaced it with an append to outerHTML in the form area.
The Wiki toggle is now just next to the submit buttons under the textarea.
This was on the To-Do list anyway.
Works fine in FF, please test in other browsers. :)
Update
tested in
==== Desktop
==== Mobile
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
Maybe have the <b>*Wiki?*</b> be a link back to Good Intentions: Wikisyntax for the Monastery, in case someone forgets their Wiki syntax from one visit to the next. :-)
Also, the syntax accepted by the nodelet hack seems to be split between the spoiler of the original post and a reply (and here for https extension, and probably other posts that I haven't noticed). It makes it rather disjointed to see what's translated by the nodelet hack. It might be nice to have all the currently-valid syntax summarized somewhere in the root post (maybe in a third section alongside code and demo sections) -- or at least update demo with the additional linking options and the features like <nowiki> which have been added over time.
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
|
|
|