From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id rdbYNPGo0F7TFgAA0tVLHw (envelope-from ) for ; Fri, 29 May 2020 06:17:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id gF4oMPGo0F4yZwAA1q6Kng (envelope-from ) for ; Fri, 29 May 2020 06:17:21 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5391F94066D for ; Fri, 29 May 2020 06:17:20 +0000 (UTC) Received: from localhost ([::1]:56558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeYKT-0003Mn-N3 for larch@yhetil.org; Fri, 29 May 2020 02:17:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeYJu-0003Mg-63 for emacs-orgmode@gnu.org; Fri, 29 May 2020 02:16:42 -0400 Received: from [183.249.132.153] (port=2021 helo=localhost) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeYJs-0003Bc-S2 for emacs-orgmode@gnu.org; Fri, 29 May 2020 02:16:41 -0400 Received: by localhost (Postfix, from userid 1000) id 01FEE24205F; Fri, 29 May 2020 14:16:27 +0800 (CST) References: <87sgflu2gw.fsf@gmail.com> <87r1v4wyy4.fsf@fastmail.fm> <87r1v4bodg.fsf@localhost> <874ks0vxpk.fsf@fastmail.fm> <87y2pbsdj0.fsf@gmail.com> <87y2pbtrh7.fsf@localhost> User-agent: mu4e 1.4; emacs 28.0.50 From: stardiviner To: Ihor Radchenko Subject: Re: [Feature] add a new org-attach dispatcher command to offline save web page In-reply-to: <87y2pbtrh7.fsf@localhost> Date: Fri, 29 May 2020 14:16:27 +0800 Message-ID: <87wo4vp8p0.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 183.249.132.153 (deferred) Received-SPF: softfail client-ip=183.249.132.153; envelope-from=numbchild@gmail.com; helo=localhost X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/29 02:16:28 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: 53 X-Spam_score: 5.3 X-Spam_bar: +++++ X-Spam_report: (5.3 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, FSL_HELO_NON_FQDN_1=0.001, HELO_LOCALHOST=3.828, NML_ADSP_CUSTOM_MED=0.9, RDNS_NONE=0.793, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: reject X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: numbchild@gmail.com Cc: Matthew Lundin , Org Mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 3.09 X-TUID: 8CktwgAflGZc =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Ihor Radchenko writes: >> As I said, PATCH welcome, I admired many times I don't have ability to b= uild 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 bef= ore. 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 writ= e 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" stru= cture 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 arou= nd. So PATCH welcome. I remember you send patch on Org Mode mailing list, I bel= ieve 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-ex= act-same-web-page-html-as-browser > > Best, > Ihor > > stardiviner writes: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA256 >> >> >> Matthew Lundin writes: >> >>> Ihor Radchenko 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 `defc= ustom', >> isn't it? User totally can change that. And I used `executable-find', th= e 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 expe= ct >>>> 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 a= rgument >> point, because user totally can do it manually, or automatic this task i= n 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 b= uild 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 functi= on to >> have enough elasticity. >> >> - --=20 >> [ 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 >>=20=20=20=20=20=20=20 >> -----BEGIN PGP SIGNATURE----- >> >> iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7QbYMUHG51bWJjaGls >> ZEBnbWFpbC5jb20ACgkQG13xyVromsOFvAgAjTPtt5ZikNZnkp1gfuEGunVzblk6 >> D6O+qgZAamT0EpR2nwK9U+x470KZAhXiLURkVb0l9/6uvA6MQZtj+umX/Qer/6bw >> vB4RICWenFKyyBMy9U1pZ9WzTNw2ZNfeaEiJ0XlgXx9ZPGjBgcLi/7FSM4NybV4O >> qbGwHbp4AzZ4mJOrMchNwlQfDYpg381xDewnHeuwtkVeBc34HpuFEGYKdmtOJ16S >> mnL/5LrbI7MahlIZuiqyAzeyU3DkSvFOC/ovvch9YlAk1SeK/BslUcaGrwl/Il70 >> XG/28XaAvVW2OYrO9vOmwpdoguQqARhKeMuof6p85waf1OF8itd97P95Lw=3D=3D >> =3DV/fu >> -----END PGP SIGNATURE----- =2D --=20 [ 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 =20=20=20=20=20=20 =2D----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7QqLsUHG51bWJjaGls ZEBnbWFpbC5jb20ACgkQG13xyVromsNlIQf/RSbkVNiqJ1PetBjIM7s7OT/frOkW s8hJQPtmCLbG0fj/aUCZyRz0qIjEfr8MY30j3tb7cfC2dlrVACrG18fQMCCzBexy Kdqc2Grq16m1dj83tvNoxXeZQdvnGtba8x13dNc3RnpjVBC10n1tfUQ96GFHEtP6 WoLW8wHs6neES2wFzOt0xnO0Z5fAjG1KmF18F+t/AcerxlJLh/7Rd0rNxxrap4fP 5PTI1tq02xX2+lzg80BuAhlLFO/NWm+dg6ON7xUoVdIbPbaTJxh58e+8EQw93CFD JQGxEvimD2w7K1hUBnspLo0cuHcL+QTQJr7ibDAxyCbqda9BvKB7fbjyCQ=3D=3D =3DuZRf =2D----END PGP SIGNATURE-----