weixin_39832965
2020-11-24 13:20 阅读 0

Hyperlink feature added

I added hyperlink feature, my editor move some lines in report.rb sorry, pls if you can just copy the hyperlink parts (or if you want I'll make a cleaner request).

Two files are changed: - report.rb : when the report is generated, all the text between {{ and }} become hyperlinks in the word report, (for example try to set {{https://test.com}} somewhere in the Serpico report editor). The code adds Relationship tags in "word/_rels/document.xml.rels" file and replaces {{URL}} with hyperlink openxml tag. - helper.rb: there are two new function: updateHyperlinks returns urls in the document and an xmlText document with hyperlinks instead of urls, and write_rels allow to write inside the "word/_rels/document.xml.rels" file.

Related Issue : #350 Thanks for your attention

该提问来源于开源项目:SerpicoProject/Serpico

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

6条回答 默认 最新

  • weixin_39832965 weixin_39832965 2020-11-24 13:20

    Ps. (do not consider setHyperlink function, this should be removed, the relevant function is updateHyperlinks)

    点赞 评论 复制链接分享
  • weixin_39614561 weixin_39614561 2020-11-24 13:20

    thank you for the PR!!

    I can copy out the hyperlink components. This looks good 👍

    点赞 评论 复制链接分享
  • weixin_39832965 weixin_39832965 2020-11-24 13:20

    :) it was a pleasure! If you prefer another syntax, change the hyperlink syntax , I've used {{ }} because it is simple and I have not seen this used in other points of code... I soon will send other questions to Serpico issue to add new features I like Serpico! If you want that I work at some relevant issue let me know!

    See you soon!

    点赞 评论 复制链接分享
  • weixin_39774808 weixin_39774808 2020-11-24 13:20

    Is this hyperlink feature going to be merged into the main branch?

    点赞 评论 复制链接分享
  • weixin_39614561 weixin_39614561 2020-11-24 13:20

    , yes. Just need to find some time to test and get it in.

    点赞 评论 复制链接分享
  • weixin_39614561 weixin_39614561 2020-11-24 13:20

    Thanks again !! This is a really useful feature, I modified it a bit and landed in master.

    cc

    点赞 评论 复制链接分享

相关推荐