• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

hnakamur/FormatLink-Firefox: A Firefox web-extension to copy the URL and the tit ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

hnakamur/FormatLink-Firefox

开源软件地址:

https://github.com/hnakamur/FormatLink-Firefox

开源编程语言:

JavaScript 81.1%

开源软件介绍:

Format Link for Firefox

Why do I need it?

To format the link of the active tab instantly to use in Markdown, reST, HTML, Text, Textile or other formats.

How to use

You can use keyboard shortcuts, context menus, or the toolbar button of Format Link extension to copy a link in the specified format. Before doing that, you can optionally select some text which may or may not contain a link.

keyboard shortcut

The keyboard shortcut for "Copy a link in the default format" is shortcut for clicking the toolbar button. The link is copied in the default format and the popup is shown under the toolbar button.

Also there are shortcuts for copying in the link in the corresponding format regardless of the default format.

See Manage extension shortcuts in Firefox | Firefox Help for showing and changing keyboard shortcuts.

context menu

Open the context menu and select the "Format Link as XXX" menu item. "XXX" in the menu item label changes as you change the default format by clicking the "Set as default" button in the popup page for the toolbar button.

If you want to disable the context menu option, you can uncheck the "Context Menus" checkbox.

If you check the "Create submenus" in the options page and save the options, submenus for each format are created under the "Format Link" context menu group.

toolbar button

When you press the toolbar button of "Format Link", the link is copied in the default format, the popup page becomes open, and the formatted text is shown in the text area.

If you want to copy the link in different format, you can press one of the radio buttons.

Also if you want to change the default format, you can press the "Set as default" button.

Flexible settings

You can modify formats in [Tools] -> [Extensions] -> Clik "Options" link in "Format Link" Extension. In format settings, you can use the mini template language.

  • {{variable}}
    • variable = title / url / page_url / text
    • The value of variable title is the HTML page title.
    • The value of variable text is the selected text if some text is selected, the link text if you open the context menu over a link, or the page URL if no text is selected and you open the context menu not over a link.
    • The value of the variable url is the link if you open the context menu over a link, the first link if selection contains a link, or the HTML page URL otherwise.
    • The value of the variable page_url is always the HTML page URL.
    • No spaces are allowed between variable name and braces.
  • {{variable.s("foo","bar")}}
    • Which means variable.replace(new RegExp("foo", 'g'), "bar")
    • You can use escape character \ in strings.
    • You must escape the first argument for string and regexp. For example, .s("\\[","\\[") means replacing \[ with \\[
    • You can chain multiple .s("foo","bar")
  • You can use the escape character \ in strings. For example, you need to escape \ with \ like \\, and also you need to escape { with \ like \{. See the LaTeX example below.
  • Other characters are treated as literal strings.

Here are examples:

  • Markdown
[{{text.s("\\[","\\[").s("\\]","\\]")}}]({{url.s("\\)","%29")}})
  • reST
{{text}} <{{url}}>`_
  • HTML
<a href="{{url.s("\"","&quot;")}}">{{text.s("<","&lt;")}}</a>
  • Text
{{text}}\n{{url}}
  • Redmine Texitile
"{{title.s("\"","&quot;").s("\\[","&#91;")}}":{{url}}
  • LaTeX
\\href\{{{url}}\}\{{{text}}\}

KNOWN LIMITATIONS

License

MIT License. Source codes are hosted at Github

Credits

Icon

I synthesized two icons (a pencil and a link) to produce icon.png.

Extension

This extension "Format Link" are inspired by extensions below:




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap