Here are my different propositions to improve the DOM Tree used by MoinMoin 2.0

Legends

Proposed tags

Element currently used in the DOM Tree, but not listed on BastianBlank page

Element and attributes already in the tree

I put some values for attributes in bold. It means that I want to use these values, even if I never saw it used in the DOM Tree before.

The Tree

Nota benne

I imply that any element without namespace, are from the moinpage namespace. This is just to avoid repetition, and improve the readibility

Page structure

Element

Attributes

Signification

<page>

It represents the page. It includes one body only.

<body>

This element includes the text content of a page. It mainly consists of a sequence of paragraphs and other text sections.

<separator>

This element defines a separation in the page

size

Specify the thickness of the separator

<table-of-content>

This element adds a Table Of Content on the page, based on the headings.

outline-level

Specify the maximum depth the ToC should display.

<part>

Contain a part of the page.

<error>

Display an error message.

Basic Text Structure

Element

Attributes

Signification

<h>

It represents a heading.

outline-level

Define the level of the heading, starting with 1

<p>

It represents a paragraph

List

Element

Attributes

Signification

<list>

It represents a list

item-label-generate

Attribute specifies that the item labels should be generated with a specific pattern. Without, it will use the item label, otherwise, it will use use the specified label. The values can be : unordered or ordered.

list-style-type

Attribute specifies the style of the list. It can be upper-alpha, upper-roman, lower-roman and lower-aplha

<list-item>

It represents an item of a list

<list-item-label>

It represents the label of an item of a list. It must only be used if no label generation is used and can only contain inline elements.

<list-item-body>

It represents the content of an item of a list. It can contain paragraphs, headings and other lists.

Table

Element

Attributes

Signification

<table>

It represents a table.

<table-header>

It represents a table header.

<table-footer>

It represents a table footer.

<table-body>

It represents a table body.

<table-row>

It represents a table row.

<table-cell>

It represents a table cell.

number-rows-spanned

Determine the number of rows, the cell should spanned.

number-columns-spanned

Determine the number of columns, the cell should spanned.

Paragraph Elements Content

Element

Attributes

Signification

<line-break />

It represents a line break in a heading or paragraph.

<span>

It represents portions of text that are attributed.

baseline-shift

It represents the shift of the text baseline. It can take the values : sub or super

text-decoration

It represents the different decoration we can apply to the text. It can take the values underline or line-through.

font-size

It represents the font size we should apply to the text. I only saw percentage at this time.

<a>

It represents a hyperlink.

xlink:href

This attribute specifies the target IRI.

<note>

It represents a note. This can be either a footnote or an endnote.

note-class

This attribute specifies the type of note this is. Available are footnote and endnote.

<note-body>

It represents the body of note, it is a mandatory child for <note>.

<strong>

It represents a stronger text.

<emphasis>

It represents an emphasized text.

<code>

It represents an inline piece of code.

<blockcode>

It represents a piece of code.

<quote>

It represents an inline quotation.

<blockquote>

It represents a quotation.

source

It defines the source of the quotation, it can be an author, a book ...

Admonitions

<admonition>

It represents an admonition.

type

It defines the type of the admonition, it can be caution, warning, important, note, tip

Admonitions

<object>

It represents an external object.

type

It defines the mimetype of the object.

Standard Attributes

I propose here some more attributes that any element should accept, and which can be useful for the different other format we support.

Attribute

Signification

xml:id

Identifies the unique ID value of the element.

xml:base

Specifies the base URI of the element and its descendants.

xml:lang

Specifies the natural language of the element and its descendants.

html:title

Give a title as a meta-information for the given element

html:class

Define a group of elements.

html:style

/!\ Can be used to apply style on the elements /!\

Discussions

Questions form IRC

 valeuf: waldi: what do you think is the best to handle style for the element in the dom tree ? having style attributes with kind of pesudo css syntax, or use different attributes for each kind of style we support ?
 valeuf: like to define the background color and the border size of an array we could have
 valeuf: 1. <table style="border-size:1; bg-color:#ccc"></table>
 valeuf: or 2. <table border-size="1" bg-color="#ccc"> </table>
 valeuf: or 3. Do you think we should avoid to have style definition in the Dom Tree ?

I found the following test in test_moinwiki_in.py :

            (u'Text',
                '<page><body style="background-color: red"><p>Text</p></body></page>',
                {'arguments': Arguments(keyword={'style': 'background-color: red'})}),

Should I assume that style attribute can be used for any element ? Should I use similar syntax to CSS ? If we use the style attribute, why would we need font-size, text-decoration and so ... for the span tag ?

MoinMoin: ValentinJaniaut/GSoC/TreeOutputModification (last edited 2010-08-15 17:17:35 by ValentinJaniaut)