thinreports / thinreports-generator

A Ruby library for Thinreports
https://github.com/thinreports/thinreports
MIT License
298 stars 48 forks source link

Support inline format of Prawn in Text and TextBlock #5

Open hidakatsuya opened 10 years ago

hidakatsuya commented 10 years ago

Prawn's inline formatting: http://rubydoc.info/gems/prawn/0.12.0/Prawn/Text:text

Support formats:

Support table:

Format TextBlock in global TextBlock in List Text
<b> Yes Yes Yes
<i> Yes Yes Yes
<u> Yes Yes Yes
<strikethrough> Yes Yes Yes
<sub> Yes Yes Yes
<sup> Yes Yes Yes
<font> Yes Yes Yes
<color> Yes Yes Yes
<link> Yes Yes Yes

Example:

page.item(:text).value('<b>ThinReports</b> official site is <i>thinreports.org</i>')

=> ThinReports official site is thinreports.org.

elshaka commented 10 years ago

I ended up monkey-patching the text_box method in my rails app. It's a terrible approach but at least it got the job done for now.

Inline format works as expected except for the fact that links are not clickable when you use them inside a list for some reason.

hidakatsuya commented 10 years ago

Thank you for your advice.

My implementation for this feature is almost the same as your. Also inline format is enabled by thinreports/thinreports-editor#12.

hidakatsuya commented 10 years ago

I think that a problem that links are not clickable is probably caused by prawn's bug (or specification). So i have reported the issue to prawnpdf/prawn#801.

hidakatsuya commented 9 years ago

The Inline link wont't supports.

hidakatsuya commented 9 years ago

We will support a part in this version as below:

Format TextBlock in global TextBlock in List Text
<b> Yes Yes Yes
<i> Yes Yes Yes
<u> Yes Yes Yes
<strikethrough> Yes Yes Yes
<sub> Yes Yes Yes
<sup> Yes Yes Yes
<font> Yes Yes Yes
<color> Yes Yes Yes
<link> Yes No No
hidakatsuya commented 9 years ago

We have desided that we don't fix this feature in v0.8. Becase following cases don't work:

So, we will move the feature to v1.0.0 milestone.

hidakatsuya commented 9 years ago

This feature will be implemented in 1.0.0, because prawnpdf/prawn#801 have been fixed in prawn 2.0.1.

juggy commented 9 years ago

Can this be merged back? It seems prawn issue is fixed.

hidakatsuya commented 9 years ago

Can this be merged back? It seems prawn issue is fixed.

Yes, we will try to merge it in v1.0.0.

willjohnson commented 8 years ago

@elshaka Can you provide a new link to your workaround for this?

Thanks!

elshaka commented 8 years ago

@willjohnson here ! It's an old monkey patch, you should check if it still does the job, I'm not using it right now.

mukuls-brdsys commented 8 years ago

Any eta for 1.0.0 ?

hidakatsuya commented 8 years ago

@mukuls-brdsys

Any eta for 1.0.0 ?

The specific release schedule is undecided.