spreadsheet_architect icon indicating copy to clipboard operation
spreadsheet_architect copied to clipboard

Add support for hyperlinks

Open westonganger opened this issue 4 years ago • 3 comments
trafficstars

Would be nice if we could support hyperlinks

https://github.com/caxlsx/caxlsx/blob/master/examples/hyperlink_example.md

westonganger avatar May 27 '21 17:05 westonganger

Hi @westonganger , do we have the support for hyperlinks now? I checked the doc and code, seems I can not find it.

teddy1004 avatar Aug 26 '22 08:08 teddy1004

No there isnt currently support for hyperlinks.

Best way for the Spreadsheet Architect API would be to implement it as a column type, however this would not support any custom text to show rather than the URL.

For XLSX: The axlsx docs above sort of elude to custom text support with the "Next Sheet" hyperlink however its not obvious to me how that works.

For ODS: We can use https://github.com/westonganger/rodf/blob/270f4ebbc401b9cfc282bc465fe54eaee0d04e63/spec/cell_spec.rb#L80 rodf does support the custom text however not sure how we would make SpreadsheetArchitect utilize this. May just have to compromise on no custom text we will see.

westonganger avatar Aug 29 '22 23:08 westonganger

Discussing Axlsx custom text capabilities in https://github.com/caxlsx/caxlsx/issues/160

For SpreadsheetArchitect we will not utilize custom text since the API for spreadsheet architect doesnt support it in an intuitive manner.

westonganger avatar Aug 29 '22 23:08 westonganger

@teddy1004 we now support hyperlinks for XLSX and ODS. If you pull the master branch then you should be able to test this feature, would love to get your feedback.

westonganger avatar Sep 29 '22 05:09 westonganger

thanks @westonganger ! really appreciate your hard work, I'd like to test it out, but I don't know how should I use it? will it parse the URL in the text automatically or do I need to configure it manually? can you please give me more guides on this? huge thanks!

teddy1004 avatar Sep 29 '22 10:09 teddy1004

You could follow the example spec from the PR https://github.com/westonganger/spreadsheet_architect/blob/4990966ff05436569e148cbe4c58a563130e3af3/test/unit/xlsx/general_test.rb#L121

That should be enough to get you going. Shouldnt need any manual configuration other than setting the column type.

westonganger avatar Sep 30 '22 04:09 westonganger

@westonganger thank you so much! I tried with URLs and it works! but I also got columns that have both string and hyperlinks, seems there's no way to do so, right?

teddy1004 avatar Oct 08 '22 14:10 teddy1004

@teddy1004 I have created the following issue #50 to implement the ability to dynamically set the column type

westonganger avatar Oct 08 '22 17:10 westonganger

I've now merged #51 to master to allow dynamically setting the column type

westonganger avatar Oct 30 '22 06:10 westonganger