← Back to team overview

launchpad-dev team mailing list archive

text markup in launchpad

 

It would be nice if user text within Launchpad could be more than just
plain monospace. <https://bugs.launchpad.net/launchpad/+bug/391780>

 * to let a Launchpad project or person homepage be more like a
project's real home page, at least for small projects
 * so people can make comments on bugs and elsewhere more readable, by
for instance emphasizing some parts or making some text monospace
 * it would let less text _need_ to be monospace by default which
might make things look nicer
 * it would be a step towards keeping blueprint text actually in Launchpad
 * it's been requested by Bryce on behalf of Ubuntu

This is a step towards what people mean when they say they want wikis,
but it's one particular aspect of wikis that is pretty well defined.
Then we can look at syncing them with branches, online editors,
versioning, whatever, later.
(https://bugs.launchpad.net/launchpad/+bug/240067)

We need to choose a particular text markup syntax.  In some ways ReST
is a natural fit for Python, but it's not actually the easiest syntax
to type by a long way: there are several link syntaxes, several of
which are hard to get right, and the underline style for headings is
hard to type in a non-monospace font.  Markdown is popular, is used on
AskUbuntu amongst others, has Python and js libraries, and is not bad
to type.

At this level it probably goes without saying this mustn't be bad for
performance and must not open up security risks particularly xss or
attacks against the parser/renderer.  python-markdown has a 'safe
mode'.

We will probably want to tweak the renderer to at least keep
highlighting 'bug 123' and perhaps more in future.  python-markdown
looks like it can be extended reasonably well without actually
patching the code.

http://github.github.com/github-flavored-markdown/ shows how github do
it and I think many of their tweaks make a lot of sense for comments
about code or coming in through web forms.  Some of these at least are
already in python-markdown.

Proposal:

 * Add python-markdown as an egg
 * Hook it up as a TAL renderer
 * At first do this only for, say, project descriptions, and only
behind a feature flag.
 * If that works, roll it out over larger scopes.

Some issues:

 * People are going to tend to make mistakes typing markup, especially
when they are new to it.  So it is problematic to put it into any of
the several text things in Launchpad that are immutable once created,
like bug comments.  I propose to handle this by using it at first only
for editable text, and then to make all text be editable, at least for
a few minutes (which is a popular bug in its own right,
http://pad.lv/80895.)

 * There's a lot of existing text in Launchpad that was entered with
no concept of it being rendered as markup, which may look weird if we
change it that way.  I propose to handle it by, in the first instance,
seeing how much of it does actually look bad.  If it's a serious
problem, then we can update the database to put everything affected in
to a literal block.  Or, we can perhaps do some schema change to say
"this text is pre-markup" but that seems like it's going to need lots
of one-off changes.

-- 
Martin


Follow ups