My immediate thought was to define a few macros using creoleparser's
macro system, but after thinking for a while, I realized I would much
rather have audio and video elements be referenced using the existing
syntax currently used for image elements. If the target of the link is
an audio or video wiki resource, a <video> or <audio> element will be
used instead of <img>.
Has anybody else implemented audio and video elements on a creole wiki?
Does anyone have thoughts on this idea?
I noticed that Wikipedia, for one, uses the same syntax for both video
and image transclusions.
Assuming we determine that moving forward is a going idea, I intend to
create a fork of creoleparser where we can experiment. This effort will
ultimately lead to a patch if it seems that such a patch would be accepted.
Regards,
Jim
On 09/17/2010 10:59 AM, Stephen Day wrote:
> I'm not aware of a Creole implementation that supports this. I have,
> however, thought about how to support it (actually, I was considering
> using the <object> element, but that was before HTML5 started to gain
> major traction).
I asked in #creole on Freenode, and Radomir Dopieralski mentioned that
MoinMoin actually supports this syntax for arbitrary transclusions:
http://moinmo.in/HelpOnLinking#Embedding
> The obvious challenge for creoleparser is knowing which element to use
> (img, video, audio, object?) as the markup would be the same for all
> (double curly braces). I supposed a start would be to just use the
> file extension of the target to make this determination, and default
> to img if none is present. Going further, there could be an explicit
> syntax introduced, eg. {{target|alt|type=video}}.
I think in most cases, a wiki engine will have access to the target and
will be able to decide for itself what type it is. Some wikis will do
this by looking at the file extension; others will look up the resource
in question before knowing what type it is. The proposed explicit
syntax may be useful for some wikis that actually don't know what a
resource represents, but I cannot at the moment think of any use-case
where this would be true.
I think the most flexible way to implement this feature would be to make
a user-definable function (or an easily subclassable class) that takes a
few parameters and returns a genshi Markup object. By default, this
function would return an <img> tag always; or it could default to a
function that instead returns an <audio> or <video> tag if the file
extension is recognized as such.
- Jim
On 09/17/2010 10:59 AM, Stephen Day wrote:
> I'm not aware of a Creole implementation that supports this. I have,
> however, thought about how to support it (actually, I was considering
> using the <object> element, but that was before HTML5 started to gain
> major traction).
I asked in #creole on Freenode, and Radomir Dopieralski mentioned that
MoinMoin actually supports this syntax for arbitrary transclusions:
http://moinmo.in/HelpOnLinking#Embedding
> The obvious challenge for creoleparser is knowing which element to use
> (img, video, audio, object?) as the markup would be the same for all
> (double curly braces). I supposed a start would be to just use the
> file extension of the target to make this determination, and default
> to img if none is present. Going further, there could be an explicit
> syntax introduced, eg. {{target|alt|type=video}}.
I think in most cases, a wiki engine will have access to the target and