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

yorkxin/copy-as-markdown: Copying Link, Image and Tab(s) as Markdown Much Easier ...

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

开源软件名称(OpenSource Name):

yorkxin/copy-as-markdown

开源软件地址(OpenSource Url):

https://github.com/yorkxin/copy-as-markdown

开源编程语言(OpenSource Language):

JavaScript 78.4%

开源软件介绍(OpenSource Introduction):

Copy as Markdown for Chrome & Firefox

Do you often type Markdown code manually for a link or image, or even all tabs in a window, and feel tired? Copy as Markdown can help you!

Download

Features

Copy as Markdown is a browser extension helps you copy the following things as Markdown to your system clipboard:

☑️ Current Tab as Link
☑️ A Link in the Page
☑️ An Image in the Page
☑️ An Image that is wrapped with a Link
☑️ All Tabs as a List of Links
☑️ Highlighted Tabs as a List of Links

Keyboard Shortcuts

You can add keyboard shortuts for copying tab(s) as Markdown. By default, Copy as Markdown does not assign any keyboard shortcuts.

Firefox

Please refer to this Firefox Help: https://support.mozilla.org/en-US/kb/manage-extension-shortcuts-firefox

Chrome

The Keyboard Shortcuts of extensions can be found at chrome://extensions/shortcuts URL. (Paste and open the link in the Location Bar).

Known Issues

  • [Chrome] When copying an image, the image code does not include the alternative text of that image. This is due to API restriction.

Development

Here is the forder structure. Platform-specific folder is used to resolve browser inconsistencies.

src/               # Shared Source Code
  background.js
  ...
chrome/            # Chrome / Chromium files
  dist/            # ../src will be copied here
  mainfest.json
  ...
firefox-mv2/       # Firefox Manifest V2 files
  dist/            # ../src will be copied here
  mainfest.json
  background.html  # Loads ESModule
  ...
firefox/           # Firefox Manifest V3 files
  dist/            # ../src will be copied here
  mainfest.json
  background.html  # Loads ESModule
  ...
compile.sh         # Copies src/**/* to <platform>/dist/

Install dependencies

npm install -g web-ext
npm install

Debugging

Since the source code are copied to platform-specific folders by compile.sh, it is recommended to use the auto-reload test script.

npm debug-chrome
npm debug-firefox
npm debug-firefox-mv3   // Requires Firefox Developer Edition

For manual debugging without auto-reload:

  • Chrome: [Window] Menu -> Extensions -> Load unpacked extension
  • Firefox: [Tools] Menu -> Add-ons -> [Gear] Icon -> Debug Add-ons -> Load Temporary Add-on

Tests

Unit tests are written in mocha, ./test/**/*.test.js.

To run, use npm test.

QA

There is a qa.html that includes various edge test cases. Open it in the browser, then try Copy as Markdown with the content in it.

License

See MIT-LICENSE.txt




鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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