Bug 319977 - wikitext-to-eclipse-help for Trac doesn't support images
Summary: wikitext-to-eclipse-help for Trac doesn't support images
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 1.3   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 1.4.0   Edit
Assignee: Mat Booth CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2010-07-15 08:36 EDT by Alexander Kurtakov CLA
Modified: 2011-01-12 12:19 EST (History)
1 user (show)

See Also:


Attachments
Image Macro Support (10.93 KB, patch)
2010-12-20 19:16 EST, Mat Booth CLA
no flags Details | Diff
mylyn/context/zip (3.08 KB, application/octet-stream)
2011-01-06 21:19 EST, David Green CLA
no flags Details
Patch to add image macro support to Trac wiki parser (12.71 KB, patch)
2011-01-09 12:38 EST, Mat Booth CLA
greensopinion: iplog+
Details | Diff
Patch to add tests for Trac image macro support (4.53 KB, patch)
2011-01-09 12:39 EST, Mat Booth CLA
greensopinion: iplog+
Details | Diff
mylyn/context/zip (8.42 KB, application/octet-stream)
2011-01-10 12:05 EST, David Green CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kurtakov CLA 2010-07-15 08:36:40 EDT
Using wikitext-to-eclipse-help ant task with markupLanguage="org.eclipse.mylyn.wikitext.tracwiki.core.TracWikiLanguage" doesn't handle [[Image(your_image_name]] properly. a href tag is created (not proper though) when img tag is supposed to be created.
Comment 1 David Green CLA 2010-07-22 13:33:28 EDT
Thanks for the bug.  Images have not been implemented in /org.eclipse.mylyn.wikitext.tracwiki.core
Please feel free to contribute a patch!
Comment 2 Mat Booth CLA 2010-12-19 19:29:11 EST
Just to let people know, I am working on a patch for this.

I rather want this to work for the ShellEd project, you see. :-)
Comment 3 Alexander Kurtakov CLA 2010-12-20 01:07:15 EST
Thanks Mat, 
It's highly appreciated - I never managed to get back to it.
Comment 4 Alexander Kurtakov CLA 2010-12-20 01:10:45 EST
Can you also consider making ant tasks for trac wiki like the ones for mediawiki (e.g. mediawiki-to-eclipse-help). See http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.mylyn.wikitext.help.ui/help/Markup-Conversion.html
Comment 5 Mat Booth CLA 2010-12-20 06:09:42 EST
(In reply to comment #4)
> Can you also consider making ant tasks for trac wiki like the ones for
> mediawiki (e.g. mediawiki-to-eclipse-help). See
> http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.mylyn.wikitext.help.ui/help/Markup-Conversion.html

Yeah, I have considered it. I originally set out to make a doc plug-in that generates its contents in the same way that the Spec-File and Fedora-Packager plug-ins do.

I came to this bug after peeling back the layers of what needs to be done to achieve that...
Comment 6 Mat Booth CLA 2010-12-20 19:15:33 EST
Hi, for initial feedback, I have attached a patch that now detects Trac wiki macros in the format of:

[[MacroName]] or [[MacroName(arg1, arg2, ...)]]

And processes the macros it knows and discards the macros it doesn't, which means it no longer attempts to make links where it shouldn't (it was previously mangling them horribly).

It currently recognises one macro, the [[Image()]] macro and supports most of the macro's parameters.

Current limitations are that it probably only works if the image in question is attached the same wiki page in which the macro appears, like this: [[Image(photo.jpg)]] or if the URL is spelled out in full like: [[Image(http://blah/photo.jpg)]]

I will write some tests and submit those as a separate patch. But I would just like some feedback on this early version to make sure I'm going about things in the right way.

Thanks!
Mat
Comment 7 Mat Booth CLA 2010-12-20 19:16:33 EST
Created attachment 185605 [details]
Image Macro Support
Comment 8 David Green CLA 2011-01-06 21:19:05 EST
The patch looks great!  A couple of things:

* the percentage concept should apply for both height and width to ImageAttributes, and corresonding changes in HtmlDocumentBuilder
* please provide some unit tests that exercise your code
Comment 9 David Green CLA 2011-01-06 21:19:15 EST
Created attachment 186243 [details]
mylyn/context/zip
Comment 10 Mat Booth CLA 2011-01-07 05:15:17 EST
(In reply to comment #8)
> The patch looks great!  A couple of things:
> 
> * the percentage concept should apply for both height and width to
> ImageAttributes, and corresonding changes in HtmlDocumentBuilder
> * please provide some unit tests that exercise your code


I was mistaken in my assumption that percentage values didn't apply to height (I couldn't get it to work in my browser, but after some reading it was probably because the image wasn't in a containing block.)

I will address these points in the next version of the patch. Thanks very much for the feedback.
Comment 11 Mat Booth CLA 2011-01-09 12:38:26 EST
Created attachment 186342 [details]
Patch to add image macro support to Trac wiki parser

Updated patch. Now supports both widths and heights specified as percentages and now you may also put more than macro in the same paragraph.
Comment 12 Mat Booth CLA 2011-01-09 12:39:41 EST
Created attachment 186343 [details]
Patch to add tests for Trac image macro support

This patch adds tests for the previous patch.
Comment 13 David Green CLA 2011-01-10 12:05:02 EST
Thanks for the great patch Mat!

pushed changeset 6b601bfabd0a73b30abb0e61671809426912b0c2
Comment 14 David Green CLA 2011-01-10 12:05:04 EST
Created attachment 186403 [details]
mylyn/context/zip
Comment 15 David Green CLA 2011-01-12 12:19:32 EST
reopening so that I can give credit to Mat for the patch
Comment 16 David Green CLA 2011-01-12 12:19:54 EST
assigning to Mat for credit