Ward called this "hiding the gibberish", new term for me as a non native speaker. To explain this tag to someone you could say "This is the gibberish tag" - If people see this they can safely skipp it, but instead of seeing that huge "gibberish" code that they don't understand, they just see this.
I like the word "gibberish" (or "native") far more than I like the world "Placeholder". The word "placeholder" implies that the markup is not in mixed mode, but rather in creole mode.
I think we might want to invent a better name. I suggest "WikiSpeck" - as in a "smudge". It's also a bad non-native English speaker pun on the word "WikiSpeak"...
Can you give an example of placeholder usage?
-- MartinBudden, 2006-12-06
The difference between placeholders and transclusions is not very clear, at least for me.
However, there should be a way (a suggested way) to include metadata about the document (author, date, location, dublin-core-like info). Could placeholder be used for this kind of extensions?
-- Michele Tomaiuolo, 2007-02-09
I think placeholders are only used at edit time. When the user clicks edit, the wiki simplifies the page contents by replacing chunks of "stuff" with placeholders. Then its all re-integrated once the user submits.
-- JaredWilliams, 2007-02-09
I really don't see it why our implementations are wrong. The descriptions of the "memento pattern" say that it actually holds the whole state of the object in question. So, with a MoinMoin macro like this:
[[TableOfContents(3)]]we have two choices -- encode the object's state in some weird, geeky base64-ed code:
Plugin insertion failed: Could not find plugin dda7d0fa6d68b30c5803e5427987a509Plugin insertion failed: Could not find plugin dda7d0fa6d68b30c5803e5427987a509
or note that the exact text of the makro call also perfectly describes its state, and in a human-readable manner on top of that! We can also skip the reduntant characters:
Table of Contents
As I see it, it perfectly meets all the definitions of a memento pattern that I found. And I see no reason why this can't also be saved like htis -- after all, Creole doesn't define how the pages have to be stored, does it?
Note also, that while your approach doesn't allow to copy the text from wiki to wiki, it also doesn't allow you to copy it from page to page on the same wiki or even rename the page (unless there is a separate action for that).
Since the markup is not transferable between wikis, the exact text that appears between Plugin insertion failed: Could not find plugin andPlugin insertion failed: Could not find plugin and is totally irrelevant.
-- RadomirDopieralski, 2007-02-23
Radomir, who is our & your?
I was thinking along the lines of the base64 approach, for an initial implementation. Use a cryptographic hash of the text, truncated to the shortest length that still ensures uniqueness, and put the actual text into a seperate form element. In theory an more appropriate UI for editting (if its applicable) the Placeholder contents could be shown. There is also a possible security use, in that if a user is not allowed to edit a particular section, then could use a placeholder to prevent it.
But haven't implemented yet, so possibly haven't throught through all possible uses.
-- JaredWilliams, 2007-02-23
Sorry for the awkward pronouns. Please treat my "our implementation" I used as if it was "implementation similar to the one used in MoinMoin Creole plugin".
I can't see any advantage of using a hash instead of the actual content. It can be used for identifying and checking "read only" parts of text as well -- since it's as unique as any hash would be.
I'm not in any way opposed to using hashes or just consecutive numbers or letters if it's better/easier/neater in your particular implementation. I just don't see how using the identity function for hashing is against the specification.
Btw, I'm all for defining a separate markup for macros/plugins/extensions. I think it should go to the Creole additions though.
-- RadomirDopieralski, 2007-02-23
I suppose it depends on how much content there is. If it spans multiple lines, reducing it to a single line helps ease editting. The MediaWiki example given in Placeholder could be quite off putting to wiki novices, I think.
Another thought, bout what are becoming common operations during editting. Using a hash, or programming (camel case) style identifiers would cause spell checkers to flag things that aren't ment to be changed. Hmm..
-- JaredWilliams, 2007-02-23
I'm more concerned that there is introduced an opportunity for errors and lost data. What should the wiki do when there is an unknown placeholder? What if the placeholder is duplicated? Data loss is possible when the user tries to move text between pages, or even on the same page, but in two edits -- he will cut the text, save to see how it looks, edit again and paste the text in different place. There is also a possibility of accidental modification of the hash during editing, either by the user himself, or by the text editor (line breaking, autoindenting, spellchecking, autocompletion). The main problem is that such a failure is fatal -- once you save, even pasting the text back wont help, because the placeholder is already deleted on the server. Sure, it's a wiki, so you can probably revert to a previous version and then retry all your changes -- but this in truns destroys the user's work. Turning the "hash" into an actual "perfect" representation of the data, just compressed and base64-encoded is one solution.
To sum up -- I agree that it can be advantagues to use hashes in cases of elaborate elements -- especially when they can contain whitespace and normal text. But at the same time, this has several drawbacks making the whole editor a little less friendly and faultproof -- so it seems that the technique can be avoided when it's not actually necessary: when the text of contained object is actually short and robust (no whitespace or other things that could make it look similar to other page content).
-- RadomirDopieralski, 2007-02-23
I suppose the ideal, would be able to use code folding to automatically fold/hide large multi-line Placeholder sections. Novices can safely ignore, advanced users can unfold the section and edit. But its pretty much impossible for HTML/JS I think. XUL/XAML or some other tech would have to be used.
-- JaredWilliams, 2007-02-23