From: stardiviner <numbchild@gmail.com> To: Ihor Radchenko <yantar92@gmail.com> Cc: Matthew Lundin <mdl@imapmail.org>, Org Mode <emacs-orgmode@gnu.org> Subject: Re: [Feature] add a new org-attach dispatcher command to offline save web page Date: Fri, 29 May 2020 14:16:27 +0800 [thread overview] Message-ID: <87wo4vp8p0.fsf@gmail.com> (raw) In-Reply-To: <87y2pbtrh7.fsf@localhost> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Ihor Radchenko <yantar92@gmail.com> writes: >> As I said, PATCH welcome, I admired many times I don't have ability to build a >> complex archive functionality on url.el or wget or curl. > > I have found the following solution [1] using wget: > > wget --mirror -p --convert-links -P ./LOCAL-DIR WEBSITE-URL I know this "--mirror" option. I used this solution to archive web page before. Make this command work in org-attach is a little bit of complicated. I have considered it on current org-attach code. With my Elisp ability, can't write it out. Still not very good at Elisp :( > > This will not bundle the page into a single file, but it is better than > nothing. org-attach does not have to attach exactly one file. You can check out function `org-attach-attach` source code, the "cond" structure is the most commands. I remember org-attach dispatcher used to have a command to move directory directly. But it seems removed. Now, all org-attach commands only supports file. I also search Elisp functions, can't find a function to move directory around. So PATCH welcome. I remember you send patch on Org Mode mailing list, I believe you at least is same kind of newbie like me who can write a little Elisp. :) > > [1] https://askubuntu.com/questions/411540/how-to-get-wget-to-download-exact-same-web-page-html-as-browser > > Best, > Ihor > > stardiviner <numbchild@gmail.com> writes: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA256 >> >> >> Matthew Lundin <mdl@imapmail.org> writes: >> >>> Ihor Radchenko <yantar92@gmail.com> writes: >>> >>>> It does not mean that attaching URL directly is not worth including >>>> into org. This sounds pretty common use case, especially considering >>>> the number of packages providing similar feature. You mentioned >>>> org-board, but there is also org-download and org-web-tools. >>> >>> My uneasiness has more to do with the specificity of the dependence on >>> monolith and the way that is hard-coded into the patch. When it comes to >>> patches, I think priority should go to those that are configurable, >>> accessible, and useful for everyone as opposed to those that have >>> hard-coded work-flows or highly-specific user configurations. >> >> I don't think it's hardcoded, As I said in my first email, It's an `defcustom', >> isn't it? User totally can change that. And I used `executable-find', the value >> will be `nil' when monolith is not available. And I don't have ability to >> archive same functionality with wget or curl. And as I said before, PATCH >> welcome. >> >>> >>>> I agree that monolith is completely uncommon tool and I would not expect >>>> the majority of users to have it installed, but the same functionality >>>> utilising built-in url.el (as a default) should be acceptable. >>> >>> The question is: which functionality? A simple downloading tool or a >>> full archival tool? Achieving similar functionality to org-board or >>> monolith would a big task, since they aim to download an archival >>> version of a webpage (including all resources). In addition, with >>> archiving you also quickly run into the complexity of versioning based >>> on time archived. There's also the challenge of mapping the downloaded >>> files to metadata (specifically the original url). Org-board currently >>> handles both of these very well. >> >> If you mean adding a timestamp and original URL, I don't think its our argument >> point, because user totally can do it manually, or automatic this task in some >> kind of way. WDYT? >> >>> >>> I suppose there would be a few options depending on what the aims are: >>> >>> 1. At the simple end, include little more than than a quick and dirty >>> way of downloading a single resource (html, pdf, jpeg) using url.el >>> or wget (or optionally, monolith) and putting that in the attachment >>> folder. Those who want full archiving of all resources could use >>> other tools like org-board or org-web-tools. >> >> the [u] url downloading method already did the simple task. >> >>> >>> 2. At the (much) more complex end, it would be to code out a robust >>> archiving solution on top of url.el or wget. >> >> As I said, PATCH welcome, I admired many times I don't have ability to build a >> complex archive functionality on url.el or wget or curl. >> >> Isn't Org Mode build up from small things? Can just become a big tool at once? >> >>> >>> 3. Another, possibly simpler option... Add a command to the dispatcher >>> that allows the user to invoke a custom function that is called with >>> the attachment directory as the default-directory. This would enable >>> more end-user flexibility, such as the ability to use >>> wkhtmtoimage/wkhtmltopdf, monolith, phantom.js, archive.is, etc. >>> >> >> This is leaved to `defcustom' option. I will improve the download function to >> have enough elasticity. >> >> - -- >> [ stardiviner ] >> I try to make every word tell the meaning that I want to express. >> >> Blog: https://stardiviner.github.io/ >> IRC(freenode): stardiviner, Matrix: stardiviner >> GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 >> >> -----BEGIN PGP SIGNATURE----- >> >> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7QbYMUHG51bWJjaGls >> ZEBnbWFpbC5jb20ACgkQG13xyVromsOFvAgAjTPtt5ZikNZnkp1gfuEGunVzblk6 >> D6O+qgZAamT0EpR2nwK9U+x470KZAhXiLURkVb0l9/6uvA6MQZtj+umX/Qer/6bw >> vB4RICWenFKyyBMy9U1pZ9WzTNw2ZNfeaEiJ0XlgXx9ZPGjBgcLi/7FSM4NybV4O >> qbGwHbp4AzZ4mJOrMchNwlQfDYpg381xDewnHeuwtkVeBc34HpuFEGYKdmtOJ16S >> mnL/5LrbI7MahlIZuiqyAzeyU3DkSvFOC/ovvch9YlAk1SeK/BslUcaGrwl/Il70 >> XG/28XaAvVW2OYrO9vOmwpdoguQqARhKeMuof6p85waf1OF8itd97P95Lw== >> =V/fu >> -----END PGP SIGNATURE----- - -- [ stardiviner ] I try to make every word tell the meaning that I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 -----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7QqLsUHG51bWJjaGls ZEBnbWFpbC5jb20ACgkQG13xyVromsNlIQf/RSbkVNiqJ1PetBjIM7s7OT/frOkW s8hJQPtmCLbG0fj/aUCZyRz0qIjEfr8MY30j3tb7cfC2dlrVACrG18fQMCCzBexy Kdqc2Grq16m1dj83tvNoxXeZQdvnGtba8x13dNc3RnpjVBC10n1tfUQ96GFHEtP6 WoLW8wHs6neES2wFzOt0xnO0Z5fAjG1KmF18F+t/AcerxlJLh/7Rd0rNxxrap4fP 5PTI1tq02xX2+lzg80BuAhlLFO/NWm+dg6ON7xUoVdIbPbaTJxh58e+8EQw93CFD JQGxEvimD2w7K1hUBnspLo0cuHcL+QTQJr7ibDAxyCbqda9BvKB7fbjyCQ== =uZRf -----END PGP SIGNATURE-----
next prev parent reply other threads:[~2020-05-29 6:17 UTC|newest] Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-27 9:55 stardiviner 2020-05-28 2:55 ` Matthew Lundin 2020-05-28 5:49 ` Ihor Radchenko 2020-05-28 6:39 ` stardiviner 2020-05-28 14:03 ` Ihor Radchenko 2020-05-28 16:00 ` stardiviner 2020-05-28 18:16 ` Ihor Radchenko 2020-05-28 16:19 ` Matthew Lundin 2020-05-28 17:11 ` Ihor Radchenko 2020-05-28 22:15 ` Matthew Lundin 2020-05-29 2:15 ` stardiviner 2020-05-29 2:06 ` stardiviner 2020-05-29 2:03 ` stardiviner 2020-05-29 2:17 ` Ihor Radchenko 2020-05-29 6:16 ` stardiviner [this message] 2020-05-29 15:33 ` Matthew Lundin 2020-05-29 16:32 ` stardiviner 2020-05-30 6:09 ` Ihor Radchenko 2020-05-28 6:37 ` stardiviner 2020-05-28 6:40 ` stardiviner 2020-05-28 22:24 ` Samuel Wales 2020-05-29 2:23 ` [PATCH updated] " stardiviner 2020-05-29 2:27 ` stardiviner 2020-06-02 12:20 ` Bastien 2020-06-02 14:06 ` stardiviner 2020-06-02 14:26 ` Bastien 2020-06-02 14:40 ` stardiviner 2020-06-03 15:10 ` Bastien 2020-06-03 23:34 ` stardiviner
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style List information: https://www.orgmode.org/ * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=87wo4vp8p0.fsf@gmail.com \ --to=numbchild@gmail.com \ --cc=emacs-orgmode@gnu.org \ --cc=mdl@imapmail.org \ --cc=yantar92@gmail.com \ --subject='Re: [Feature] add a new org-attach dispatcher command to offline save web page' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Code repositories for project(s) associated with this inbox: https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).