I thought it would be helpful to have all ideas about TextFormattingRules in one place. - YishayMor

Yes, and that page has traditionally been called WikiMarkupDevelopment :-). --JanneJalkanen

12/08/03 - general escape character#

Is there something like this? We could use the tilde in avery occurance, where the following char is not to be interpret, not in text and not in links. - BobSchulze

Tilde (~) is the general escape character, but unfortunately it does not yet work in many places. This is a clear problem, and should really be put on the TODOList... --JanneJalkanen

12/06/03 - editor comments - YishayMor#

Any formating / programming language I know has a "comment" construct, i.e., a way of adding text which will be ignored by the compiler. Now, why would I want this in a Wiki? Well, here's a couple of use cases:
  • We're thinking of adding forms for automating common tasks. E.g.: upload an image and link to it, add a "blog entry", etc. These forms would basicaly add some text to the page, so that you can allways hack the result if you don't like it. However, I would like to mark it, as in "<!-- begin blogEntry -->"
  • I have some outline of a page I'm working on, which I want to save, but not publish.

09/06/03 - non-breakin line break - YishayMor#

JSPWiki relies heavily on new lines in its parsing. Generaly, this is good. But sometimes, you'd like it to ignore a newline.

If I want "mary had a little lamb" in a box, as in:

Mary had a little lamb
Little lamb
Little lamb

I might prefer to write:

| Mary had a little lamb \\
  Little lamb \\
  Little lamb \\
|
but that would come out as:
Mary had a little lamb
Little lamb
Little lamb

I could, of course, do:

| Mary had a little lamb \\  Little lamb \\  Little lamb \\ |

but its less readable...

It would be nice if I could direct the parser to ignore the new line, like:

| Mary had a little lamb \\ !->
  Little lamb \\ !->
  Little lamb \\ !->
|

- YishayMor

09/06/03 - embedded structures - YishayMor#

Currently, I don't see any way of generating something like
1. Hunting snarks
   * why hunt snarks?
   * where are they?
2. building castles in the air
   * sand castles
   * cloud castles

Doing this

# Hunting snarks
* why hunt snarks?
* where are they?
# building castles in the air
* sand castles
* cloud castles
generates this:
  1. Hunting snarks
  • why hunt snarks?
  • where are they?
  1. building castles in the air
  • sand castles
  • cloud castles

I, too, would like these features, Yishay. For the structures, though, I think this syntax would be better:

# Hunting snarks
#* why hunt snarks?
#* where are they?
# building castles in the air
#* sand castles
#* cloud castles
This clearly, in my warped little brain, could tell the parser that the indented bulleted list is part of the numbered list. Comments? Janne?
--MichaelGentry

Actually, the syntax is supposed to be

# Hunting snarks
** why hunt snarks?
** where are they?
# building castles in the air
** sand castles
** cloud castles
but unfortunately there is a known bug with JSPWiki getting confused about the whole thing. There are even tests for that sort of thing in the current distribution, though they are commented out.

(BTW, this is the way that PHPWiki does it, and I think we should stick to that convention. The less there are different formatting styles, the better.)

--JanneJalkanen

Janne, I still think that if:

# Hi, I'm "1"
## Hi, I'm "1.1"
# Hi, I'm "2"
Produces:
  1. Hi, I'm "1"
    1. Hi, I'm "1.1"
  2. Hi, I'm "2"
Then:
# Hi, I'm "1"
#* Hi, I'm a bullet under "1"
# Hi, I'm "2"
Would produce the desired results (once implemented, of course). There is already logic in the engine to look after the first "#" to see if there is another "#" so it'll know to create a nested ordered list (<OL>) section. Why not have it look to see if there is a "*" after the "#" and, if so, create a nested unordered list (<UL>) section? Seems intuitive to me (and easier to implement). You'll just have to keep up with which type of list it is to emit the proper closing tag (the <LI> tags won't change at all, of course), but that logic might already be in the engine (haven't looked at the code for it yet).

--MichaelGentry

I made an implementation of this recently (based on 2.0.50 base), seems to work well.

# Hunting snarks
#* why hunt snarks?
#* where are they?
# building castles in the air
#* sand castles
#* cloud castles
comes out looking something like
1. Hunting snarks
    . why hunt snarks?
    . where are they?
2. building castles in the air
    . sand castles
    . cloud castles
More involved examples also work.

I'll post the appropriate changes if anyone is interested.

--MurrayG

I tweaked my implementation and now

# Hunting snarks
** why hunt snarks?
** where are they?
# building castles in the air
** sand castles
** cloud castles
also produces the same result.

Use your prefered variation, the key is the last character and the depth. If deeper then a nested list is started, if the same then continued, if same but different ending then the previous is closed and a new opened (i.e. changing from # to * or vice-versa). Moving to a lower level just continues that level where it left off.

--MurrayG

This works for me (JSPWiki v2.0.52)

# Hunting snarks \\
 * why hunt snarks? \\
 * where are they? \\
# building castles in the air \\
 * sand castles \\
 * cloud castles \\
-- Amir

I'd like to get a copy of the TextFormattingRules page on my own wiki, but since i can't edit it i also can't see the source - t'would be nice to have a read-only source view (especially of that page). -- tequilaron~at~ymail~dot~com


At the right top of the page there should be an option "More" , hover over it and select "View Page Source", that should give you the page source.

--Harry Metske, 21-Sep-2009 21:52


Improved and yet backward compatible bullet and number lists#

I would like very much to keep the functionality of the bullet and numbered list as they are, by default, but have the ability to change their default behavior using a command like one of these 2 lines:

%%list-control bullet="o,O,*,x,X,>,>>,&213;" bulletLevelIndent="true" %%
[{listControl  bullet="o,O,*,x,X,>,>>,&213;" bulletLevelIndent="true" }]

The 'bullet' parameter would define that a bullet list with 1 star would show an empty circle, and 2 stars would show a bigger empty circle, 3 stars would show the dot we are familiar to see, etc. The little and big letter 'O', and other character like 'X', would be short hand for other symbols, like small or large square boxes for 'X'. Those special characters would be documented. The "&213;" would represent the specific character to use as a bullet.

The 'bulletLevelIndent' parameter indicates that any non-bulletted lines should be indented as much as the previously bulletted line.

From the moment the statement above has been used, the normal behavior of the bullet list would be altered. Statements like these could be used to cancel any alteration: (I only show one model for the sake of simplicity)

[{listControl bullet="" bulletLevelIndent="false" }]
[{listControl bullet="reset" }]

A numbered list could be altered to using something like:

[{listControl number="i,n,I,a,A,n.A" numberStart="3,1" numberLevelSpan="true" numberLevelIndent="true" }]

The 'number' parameter indicates different types of numbered lists. 'i' for roman numerals, 'n' for number, 'a' for alphabet, and 'n.A' to indicate that at this level we show the preceding number, and the current number symbols.

The 'numberStart' parameter indicates that the next first level we see will start with the value "3".

The 'numberLevelSpan' indicates that even if some lines which are not numbered are generated, the next numbered line continues with the next number in the sequence, instead of restarting down at 1.

Finally, the 'numberLevelIndent' parameter indicates that any non-numbered lines should be indented as much as the previously numbered indented line.

Statements like these could be used to cancel any alteration:

[{listControl number="" numberStart="" numberLevelSpan="false" numberLevelIndent="false" }]
[{listControl number="reset" }]

And this could be used to cancel all alterations from this point on:

[{listControl list="reset" }]

So, by default, the current behavior of the bullet and number list would not be altered but, while still using the same Wiki controls, we could change the behavior for part of the document. Special care should be given to "insert" of pages. We should follow existing rules of inserts. Either, once the insert is completed, everything reverts back to what it was, or we consider the insert as an integral part of the document, as if there is only 1 page. The same could be true before we render the insert. Maybe an option on the list control, before inserts, could be useful:

[{listControl list="insertReset" }]
[{SomethingThatCauseAnInsert ]}
[{listControl list="insertRestore" }]

The first statement saves and resets the list styles to their default behavior. The second statement renders the inserted page. Finally, the last statement restores the setting to what they were saved as.

I realize all this might seems slightly complicated, but it isn't, at least not to use. As far as coding this goes, I don't know how complicated it would be.


--Gerard Perreault, 2012-01-23

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-25) was last changed on 24-Jan-2012 00:28 by GerardPerreault