Wiki syntax in OpenPLM

implemented in openPLM 1.3:  http://wiki.openplm.org/docs/1.3/en/devel/richtext.html

syntax: markdown (python-markdown jquery.markedit)

Creating pages in a wiki is very useful and lot of people appreciate formalize their ideas with it. The idea is to integrate a wiki syntax in OpenPLM.

Purpose

Render editable text fields (descriptions, comments)

Who?

  • Who will use it?
  • Does it concern all users? only new users? power users?
  • May it disturb other users ?

What?

  • What does it do?
  • Is it a new independent feature?
  • Does it replace something?
  • Does it change something?

Syntax

Requirements:

  • safe mode (no raw html, no external includes)
  • accept errors: badly formatted text should not show a warning or raise an error
  • documented
  • extensible, to add a syntax like [Part/PART_00001/a] that creates a link to the part. The idea is to do something similar to TracLinks

Optional:

  • wysiwyg / wysiwym editor
  • image (from an existing url)
  • table of contents
  • code inclusion, code highlight
  • preview
  • macros (as long as they are safe and do not break the rendering if misused)
  • pdf rendering (for official document ?)

Not needed:

  • attachments, we have documents

Ideas of some cool links (discuss them!):

[Part/PART_00001/a] or [[Part/PART_00001/a]]

link to the plmobject

#a, #b, #1.2

link to a specific revision (depending of the current object), # may conflict with markdown titles

#<, #>

previous/next revisions

file:51 or :file:51 or file:hello.txt

link to a file of the current document

[Document/DOC_00001/a:toto.txt]

link to a document file

[Document/DOC_00001/a/files], [Part/PART_00001/a/lifecycle]`

specific pages

@username

link to a user page

Candidates

Markdown

Specification

Implementations

  • python-markdown:

Editors

Trac

Specification

TracWiki, WikiFormatting

Wikipedia

reStructruredText

Specification

Implementations

User interface

Text Field

Implementation details

Mezzanine

 Mezzanine is a CMS written in Python/django. Its admin interface allows user to write rich text page with by default, a tinymce form. It is possible to replace tinymce with another widget.

Two settings are available:

For example, there is a markdown widget ( https://bitbucket.org/akhayyat/mezzanine-pagedown) which adds a pagedown widget with a preview field.

Using similar settings, it will be easy to enable or disable a particular syntax (including plain text).

Outputs

Two outputs must be rendered:

  • an HTML output
  • a text output: so that content is well indexed

It is possible to strip tags from the html output. Special characters (like title line =====) won't be a problem since xapian ignores them (they are easy to remove).

Caching rendered html?

If HTML rendering is too slow, we may stored the latest rendering in a cache database or in the postgres database.

There are some issues:

  • it is not possible to differ existing links from non existing one, like [1], [10000000000000], #1, #16 in trac
  • it requires more storage place
  • it may require a complete rebuilding in case of bugs in the html renderer

It is also possible to set up a whole cache server for openPLM and handle all cached/not cached stuff.

Explicit or implicit fields

Which textfields should be rendered ?

  • comments
  • Part/document:
    • all description fields ?
    • or textfields with a specific attribute (field = TextField(); field.is_rich_text = True)