From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Convert README.org to plain text README while installing package Date: Mon, 06 Jun 2022 10:35:25 +0000 Message-ID: <877d5ut6z6.fsf@posteo.net> References: <87leuca7v7.fsf@disroot.org> <87czfopmsd.fsf@gnu.org> <87h74ztshe.fsf@gmx.de> <871qw31ois.fsf@yahoo.com> <8735gj4ceo.fsf@gnu.org> <87sfojz63r.fsf@yahoo.com> <87h74z5nio.fsf@localhost> <87ilpf45mo.fsf@disroot.org> <87pmjnumzg.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="338"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Akib Azmain Turja , Ihor Radchenko , Po Lu , Tassilo Horn , Michael Albinus , Alan Mackenzie , Stefan Kangas , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 06 12:43:04 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nyACN-000AOx-51 for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Jun 2022 12:43:03 +0200 Original-Received: from localhost ([::1]:48806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nyACL-000583-D2 for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Jun 2022 06:43:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyA5C-0001JR-NA for emacs-devel@gnu.org; Mon, 06 Jun 2022 06:35:38 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:40185) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyA5A-0008BN-Mu for emacs-devel@gnu.org; Mon, 06 Jun 2022 06:35:38 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 4EB72240028 for ; Mon, 6 Jun 2022 12:35:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1654511732; bh=AwHHZXTYSrplkiKyscmLFxE74M7ebxG8da7UloXxWEQ=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=o8vPqTqCdTDICjg6haAkO/HIEsCZdJR0RX6laJbmppAxCVBOaL+w0ZLu7p2E/bt4v VtWQb3WWakjN/JuD2JwswGzNuRzvKjTNDjuRr5GPIODq+dTDjj8aatPA7sjOs1ES8w /TMToUndLFzH8RwP3BL2ng/aowMlWChyZ5z/DqHDwW5XHwL3uu8T3QwVfkOSWlkZVI F+lEkYyoQ6k1Aj6ZfxJiOKg9FfDbCwFHMB17mbrl7QtuiW6xoYHMK90FdFUSv9t1xU 0bqlFo/SlrUToE0tHRv+o8SIP43g0nT4Pycd4NDcxFvWb5eUosGuFLhUdfB5KZrAMp SEAISW5S1nF/Q== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LGqdG5ytZz6tm6; Mon, 6 Jun 2022 12:35:30 +0200 (CEST) X-Hashcash: 1:20:220606:akib@disroot.org::PZwEd8ZNNWYR0Y2+:00qG0 X-Hashcash: 1:20:220606:stefan@marxist.se::dtqirDxNLbQ12qBZ:000000000000000000000000000000000000000000000UQV X-Hashcash: 1:20:220606:acm@muc.de::s9lv6S1oluYZ/bbK:00000000gJ7 X-Hashcash: 1:20:220606:yantar92@gmail.com::LFqL9Pm3Zc4pWRxo:00000000000000000000000000000000000000000001zDS X-Hashcash: 1:20:220606:michael.albinus@gmx.de::p+kId/6r6VB5kq5s:0000000000000000000000000000000000000002csp X-Hashcash: 1:20:220606:emacs-devel@gnu.org::oHwn+sabTxssHf91:0000000000000000000000000000000000000000004oBa X-Hashcash: 1:20:220606:monnier@iro.umontreal.ca::/TZ5l8ChTCA20vnY:00000000000000000000000000000000000004988 X-Hashcash: 1:20:220606:luangruo@yahoo.com::AFwXNPSdWE3MikzC:00000000000000000000000000000000000000000006zSg X-Hashcash: 1:20:220606:tsdh@gnu.org::ELKjIOzMZ/GPn6IT:0000071a0 Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: (Stefan Monnier's message of "Sun, 05 Jun 2022 13:44:25 -0400") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:290779 Archived-At: --=-=-= Content-Type: text/plain Stefan Monnier writes: >> From what I see this could be fixed if elpa-admin added a "README-elpa" >> with the rendered text into the tarball. > > I think you're right. I believe this should do the job: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Render-Org-documentation-in-a-plain-text-README-elpa.patch >From 9d973044a346860d3fc6164fe75ad8cd9721a595 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Mon, 6 Jun 2022 12:34:40 +0200 Subject: [PATCH] Render Org documentation in a plain-text README-elpa file * elpa-admin.el (elpaa--make-one-tarball-1): Call elpaa--write-plain-readme. (elpaa--write-plain-readme): Add new function. --- elpa-admin.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/elpa-admin.el b/elpa-admin.el index ecf4bc90d1..60da684f1f 100644 --- a/elpa-admin.el +++ b/elpa-admin.el @@ -621,6 +621,7 @@ auxillary files unless TARBALL-ONLY is non-nil ." (elpaa--make pkg-spec dir) (elpaa--build-Info pkg-spec dir destdir)) (elpaa--write-pkg-file dir pkgname metadata revision) + (elpaa--write-plain-readme dir pkg-spec) ;; FIXME: Allow renaming files or selecting a subset of the files! (cl-assert (not (string-match "[][*\\|?]" pkgname))) (cl-assert (not (string-match "[][*\\|?]" vers))) @@ -1162,6 +1163,17 @@ Rename DIR/ to PKG-VERS/, and return the descriptor." nil pkg-file))) +(defun elpaa--write-plain-readme (pkg-dir pkg-spec) + "Render a plain text readme from PKG-SPEC in PKG-DIR. +This is only done if necessary, that is if the readme contents +are not already taken to be formatted in plain text." + (let* ((readme-content (elpaa--get-README pkg-spec pkg-dir))) + (unless (eq (car readme-content ) 'text/plain) + (write-region + (elpaa--section-to-plain-text readme-content) + nil + (expand-file-name "README-elpa" pkg-dir))))) + (defun elpaa-batch-generate-description-file (&rest _) "(Re)build the -pkg.el file for particular packages." (while command-line-args-left -- 2.36.1 --=-=-=--