• Stars
    star
    179
  • Rank 214,039 (Top 5 %)
  • Language
    TypeScript
  • License
    Other
  • Created about 3 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Firefox Add-on (WebExtension) to copy selected web page into Org-mode formatted text!

Copy as Org-Mode

A WebExtension to copy selected web page into Org-mode formatted text!

I develop and release all my open-source software projects for free, and are ALL licensed under WTFPL, GPL, MIT, or MPL. however, my “free time” is not free actually. If my works are usable to you or make you happy, please consider to donate to reduce my business hours to make more free and open-source projects for you and this world.

Attention: Donate only if you feel happy; it is totally voluntary, I would never force you to do this. I always try as possible as I can to make good project because I need, and wish my work could also be helpful to others. If you donate, I will be glad and grateful, but I cannot provide any gurantee or warranty for this project even if you do this. Thanks for your contribution!

Install

Screenshot

https://addons.mozilla.org/user-media/previews/full/261/261819.png https://addons.mozilla.org/user-media/previews/full/261/261939.png https://addons.mozilla.org/user-media/previews/full/261/261818.png

Supported Browser

  • Firefox for Desktop >= 92

Requirements for Development

  • Node
  • web-ext
  • GNU Make

All Support Syntax

  • * Outline, 1. ordered list, - unordered list, - [ ] GitHub style todo list
  • | Table | Can | Be | Copied! |
  • Paragraph <p>, Horizontal splitter --------
  • Quoteblock #+begin_quote , Codeblock (: one line code... or #+begin_src + auto guess language ID. e.g. js, c, shell)
  • *bold*, /italic/, _underline_, +strike+, =verbatim=, ~code~, _{sub}, ^{sup}
  • [[link url][link title]], [[a.href][img.src]] (Notice: multiple <img> elements + other elements wrapped in <a> element is not supported by org-mode syntax. I have serveral plans as workaround for this but haven’t decided which one is better, hence not implemented this yet..)
  • [[imgSrc]] (Notice: I haven’t decide how to deal with HTML title and alt attribute)

Known Issues (Plegase feel free to open PR to fix them)

  • It’s IMPOSSIBLE to use this add-on under some special pages or domains like https://addons.mozilla.org/ . This is the restriction of Firefox browser itself.
  • Nested mark (e.g. *=bold and=* /=italic code=/) may has some issues for org-mode renderer. This is a common usage in HTML, but may mess up the org-mode renderer. This is the limitation of org-mode’s syntax & renderer, I cannot do anything for it.
  • Some block elements in <a> (e.g. <img>) may cannot be handled properly. This is the limitation of org-mode’s syntax. I’ve not decided which workaround should I use currently.

    For example, <a> inner text 1 <img src="..."> another text 2 <img src="..."> another text 3 </a>

    • One of the workarounds I can think up so far is to split each Node and make each of them an independent links, but looks disgusting… Like [[url][inner text 1]] [[url][imgsrc]] [[url][another text 2]] [[url][imgsrc]] [[url][another text 3]]….
    • Or use #+HTML: <a href="url"> and #+HTML:</a> to wrap the children contents and elements. However, this will make the <a> to a block element and create unneeded inevitable new lines.
  • <pre> may lost newlines in some page (e.g. https://kuanyui.github.io/2017/08/16/macros-for-qproperty/). Should be fixed now but I cannot sure.
  • Notification may freeze the whole Firefox when using on Linux (Test on Firefox 92, Ubuntu & Manjaro), but such issue seems not occurs on Firefox for Windows. So I make this feature an optional setting, you can enable it manually.

Permissions

This software is created by a paranoidTM free-software & open-source enthusiast, would never collect your any data. Feel free to review the whold code base if doubt.

Permission (in manifest.json)DescriptionWill show a permission warning when install?
activeTabInsert HTML parser to current active tab.No
menusAdd items to context menu.No
clipboardWriteCopy org-mode text into clipboard.Yes
notificationsShow notification via OS when copy (optional).Yes
storageStore preferences in sync (Mozilla Sync account)No

Development

Prepare

npm i

Run for development (Watch)

make dev
web-ext run --verbose --firefox-profile ~/.mozilla/firefox/PROFILE_DIR_NAME

If webpack watch exit immediately without any error, please try https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers

Run Firefox for developing WebExtension

web-ext run --verbose --firefox-profile ~/.mozilla/firefox/XXXXXXX.NAME

Deploy (Build .xpi file & run a HTTP server for download)

make xpi-server

Zip this repository for uploading to addons.mozilla.org

make zip-repo

Acknowedgement

This project referred, forked, or used some parts of the codes from the other projects:

Project URLUsageLicenses of Used Parts
0x6b/copy-selection-as-markdownMain project structure; copy and selection handlingMIT
mixmark-io/turndownForked as HTML to Org-Mode converterMIT
piroor/treestyletabThe CSS for options_ui (settings page)MPL 2.0; MIT

TODOs

  • Customizable keyboard shortcuts.
  • Image to data URL?

License

MPL-2.0.

See LICENSE for more information.

More Repositories

1

moe-theme.el

A customizable colorful eye-candy theme for Emacser. Moe, moe, kyun!
Emacs Lisp
733
star
2

tldr.el

tldr client for Emacs
Emacs Lisp
132
star
3

hexo.el

Use Hexo in Emacs elegantly
Emacs Lisp
85
star
4

Furiganaize

A browser extension allowing the injection of phonetic annotations for Japanese text (furigana) on the fly.
JavaScript
56
star
5

fsc.el

Fuck the Speeching Censorship!
Emacs Lisp
35
star
6

takahashi.js

Make Takahashi-style slide easily!
JavaScript
31
star
7

copy-as-org-mode-legacy-firefox

[Legacy Firefox] Copy Link, Image and Table in Page as Org-mode Format!
JavaScript
28
star
8

.emacs.d

ˊ・ω・ˋ Emacs~~
Emacs Lisp
26
star
9

ta.el

Deal with homophonic Chinese characters. 受夠了「她他它祂牠」這種發音統統都是「tatatatata」的同音字?
Emacs Lisp
19
star
10

moedict.el

Moe Dictionary client for Emacs. 萌典 Emacs 版客戶端
Emacs Lisp
18
star
11

kaomoji.el

┌(┌ ^o^)┐ホモォ... Insert kaomoji (顔文字) easily
Emacs Lisp
16
star
12

cakecrumbs.el

Show parent-chain on header for HTML / Jade / Pug / LESS / SCSS / Sass / Stylus
Emacs Lisp
16
star
13

writing-utils.el

Some small tools for writing articles in Emacs.
Emacs Lisp
9
star
14

BooruShinshi

A WebExtension to download image with comprehensible filename from Booru page in one click.
TypeScript
8
star
15

zhongli-lang

用中文寫壢斯波(Lisp)!
Emacs Lisp
8
star
16

yajade-mode.el

Yet another Emacs major-mode for Jade / Pug
Emacs Lisp
7
star
17

fm-bookmarks.el

Access existed File Managers' bookmarks (e.g. Dolphin, Nautilus, PCManFM) in Dired.
Emacs Lisp
5
star
18

EngineSwitcher

A WebExtension let you switch search engine in one click.
TypeScript
5
star
19

stardict-flashcard

A flashcard program based on sdcv. Never waste time on making flashcard files anymore ˊ・ω・ˋ
Python
3
star
20

webext-copy-selected-links-as-csv

A WebExtension which can running on Firefox for Android, specially designed for Android App @Voice Aloud Reader (TTS Reader) (https://play.google.com/store/apps/details?id=com.hyperionics.avar).
TypeScript
3
star
21

open-recipe

My personal recipe notebook.
2
star
22

question_tsc_dts

TypeScript
2
star
23

recentz.el

A minimalized, KISS replacement of `recentf`
Emacs Lisp
1
star
24

PurpleLogViewer

a simple GUI chat log viewer for libpurple / Pidgin
C++
1
star
25

noto-multi-lang-with-css

Noto Sans with `unicode-range:` multi-languages supporting CSS definition for lazy-loading. (Latin, Cyrillic, Greek, CJK, Arabic, Hebrew)
CSS
1
star