Automatic code replacement
nav_first.pngFirst: thread:131
HTML Block
Edited: 11 Oct 2012 12:06 by: James Kanjo
Comments: 0
Tags:
nav_prev.pngPrevious: thread:129
ListUsers Module
Edited: 21 Mar 2010 14:34 by: leiger
Comments: 3
Tags:
Last: thread:112
Image Module
Edited: 12 Nov 2009 12:22 by: pieterh
Comments: 0
Tags:
nav_last.png
Next: thread:331
Monetization options for pro sites.
Edited: 17 Mar 2010 12:09 by: michal-frackowiak
Comments: 0
Tags:
nav_next.png

leigerleiger wrote on 15 Nov 2009 02:49

This is a design sketch for "automatic code replacement", which is a technique to save users effort when typing complex wiki syntax.

The settings are configured per-site, by the site admins.

The admin supplies two values:

  • Code
  • Replace with

When someone saves a page or comment, their code is cross-referenced with this list. If any of the code matches what is provided in the "code" column, then it is replaced with the corresponding "replace with" code at runtime1.

For example…

The site manager setting might look like this after a few entries have been made:

Code Replace with
[b] **
[/b] **
[youtube] [[include youtube |video_id=
[/youtube] ]]
contact us [[[contact]]]

This means that if someone was to type [b]Hello[/b] into the source code, it would do the same thing as **Hello** does (making the text style = bold).
Note: [b]Hello[b] and [/b]Hello[/b] would also work!

If someone were to type [youtube]_6nfVLOsj6U[/youtube], then it would convert to this: [[include youtube |video_id=_6nfVLOsj6U]] (and that included page contains code for embedding a youtube video… e.g. dimensions of the player, etc.


Start a new sub-thread

Wikidot Plugins By leiger 0 Comments 08 Mar 2010 22:07
Interesting applications that may require a re-design By rurwin 1 Comments 19 Mar 2010 10:56
I will not vote for this because By Steven Heynderickx 5 Comments 26 Nov 2009 09:37
ChrysZ would like this as well By leiger 0 Comments 26 Nov 2009 01:14

We discourage direct comments on this thread: to discuss it, please start a sub-thread.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License