Edit Section

Easy markup

PositionalMarkup is not a good name for the proposal, because it was never intended to allow only positional arguments in extensions.

Goals

Rules:

Markup

Display

Comments

[[PageName]]

PageName

[[Page Name]]

Page Name

[[PageName, Title]]

Title

[[Page Name, Title]]

Title

[[Page Name, moinmoin.png]]

moinmoin.png (links to "Page Name")

http://example.com

http://example.com

same for all other schemas

[[http://example.com]]

http://example.com

same for all other schemas

[[http://example.com, Example]]

Example

same for all other schemas

[[moinmoin.png]]

moinmoin.png

link to an attachment, will open the image in a window. Assume that attachments are pages.

[[moinmoin.png, 1000 words]]

1000 words

same with custom title

[[http://example.com, moinmoin.png]]

moinmoin.png (links to http://example.com)

[[http://example.com/moinmoin.png]]

http://example.com/moinmoin.png

link to external image - does not include the image!

[[http://example.com/moinmoin.png, Funny Man]]

Funny Man

link to external image with title

[[wiki:MoinMaster/Remote Page Name]]

interwiki link to: MoinMaster/Remote Page Name

interwiki link

[[wiki:MoinMaster/Remote Page Name, page from Master]]

page from Master (links to MoinMaster/Remote Page Name)

interwiki link

info@somedomain.org

info@somedomain.org

Extensions (macros, parsers)

Rules:

description:
markup example

linebreak macro:
{{BR}}

WordCount macro:
{{ WordCount(FrontPage, 1000) }}

indent table parser:
{{IndentTable
1                               
 2                       
  3                               
   4
}}

Python code:
{{python
import sys, os
print 'hello!'
}}

SectionParser, uses keyword arguments:
{{section(class=cssclass, format=rst)
RST markup here...
}}

Image macro, uses keywords as arguments, for example the keyword "right" means to add an image on the right side of the page:
{{ Image(sunset.jpg, thumb, right) }}
{{ Image(sunset.jpg, left) }}
{{ Image(sunset.jpg, left, thumb) }}

Empty extension default to plain plugin:
{{
plain text as is
}}

Inclusion

A stated goal is to reduce the number of concepts for the user and the moin developer. IMHO the moin core should be as small as possible. As a consequence, inclusion should be implemented as macros.

markup example

description: includes ...

Include(Featured Article)

page "Featured Article"

Include(moinmoin.png)

"moinmoin.png"

Image(moinmoin.png)

"moinmoin.png"

Image(sunset.jpg, thumb)

"sunset.jpg" as thumbnail

Image(sunset.jpg, thumb,"a sunset")

"sunset.jpg" as thumbnail, image caption "a sunset"

Image(sunset.jpg, right)

"sunset.jpg", the image is sent over to the right

Image(sunset.jpg, left)

"sunset.jpg", forced to the left

Image(sunset.jpg, 100)

"sunset.jpg", scales image to maximum size 100

Image(sunset.jpg, 200, "a sunset")

"sunset.jpg", scales image to maximum size 200, image caption "a sunset"

If images are pages or sub pages, then we don't need Image, only Include:

But then size and alignment don't not make sense for Include.

Alternative Extension Syntax

Use a colon instead of brackets to separate the macro name from the macro arguments.

{{ Image: sunset.jpg, right }}
{{ Image: sunset.jpg }}

{{ section: class=cssclass, format=rst
RST markup here...
}}

{{BR}}

{{IndentTable
1                               
 2                       
  3                               
   4
}}

Backward compability

Discussion

This proposal is more complex than KeywordMarkup, as you have both positional markup and keywords, its more like a programing language. For example, the function calling convetion: name(value, value), compared with simpler html: <tag key="value" key="value">. This also add the complexity of dealing with keyword and positional arguments in same call, just like in Python. For example, is this call correct? name(key=value, value)?

This will be harder to use for the new user, easier for a programmer. -- NirSoffer 2005-07-11 07:30:30

MoinMoin: PositionalMarkup (last edited 2007-10-29 19:09:49 by localhost)