From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [ELPA/elpa-admin] Render README.org as HTML with ox-html Date: Mon, 20 Sep 2021 00:29:09 -0400 Message-ID: References: <87h7f7zww5.fsf@alphapapa.net> <87zgszy91h.fsf_-_@alphapapa.net> <87a6ku2z8x.fsf@alphapapa.net> <87ilzc65rc.fsf@alphapapa.net> <87o88yuern.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36817"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Adam Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 20 06:30:11 2021 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 1mSAwU-0009J2-4f for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 06:30:10 +0200 Original-Received: from localhost ([::1]:41462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSAwS-0004Z4-81 for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 00:30:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSAvh-0003s5-6W for emacs-devel@gnu.org; Mon, 20 Sep 2021 00:29:21 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:58805) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSAve-0000s4-U3 for emacs-devel@gnu.org; Mon, 20 Sep 2021 00:29:20 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 511C5100189; Mon, 20 Sep 2021 00:29:16 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 86DC3100138; Mon, 20 Sep 2021 00:29:10 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1632112150; bh=26gmrlHWI1mR0ytnpaMROC1SWC23O/UGJsynKwIXY9o=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=R3DMqMAa0+6MUAqM2n1MPl9bZ1ekINxoZL+5KT/R2a9ZljFqlmyaY1GLLiuHz02So Y4uW/SOGGua1B6QT5CtPp3VCH0oygy/xwpHQPjk9DQWPATrWtJfySsQUDLJ9obPX/0 c746feprhzPxq7WYiqBImfBCwiBxdA59/ETsTZLm1O7z79cHLgOOrizrxSmT8s/Ex1 14C1uXCqzXhkf5b6QRIGvoTh/gvnyRNX00XTVH0BOcXbhS0zHrFiJ62G/bq9edvOFt 3xOzXdLFhZ+V7qZXrlBBbHeFm5d8pi2NFux7ZTtaaOon8HKqrQtuejdC900mOQBkM0 5XF4HoHTd4QSQ== Original-Received: from pastel (unknown [45.72.241.23]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 36E6C1202F4; Mon, 20 Sep 2021 00:29:10 -0400 (EDT) In-Reply-To: <87o88yuern.fsf@alphapapa.net> (Adam Porter's message of "Sun, 12 Sep 2021 08:03:56 -0500") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:275097 Archived-At: > Thanks, now I have a better idea of what you want. Hopefully this patch > is close to what you have in mind. Looks good, thanks. > - (with-temp-buffer > - (insert-file-contents (expand-file-name file srcdir)) > - (buffer-string))) > + ;; Return FILE's contents. > + (let ((type > + (pcase (mailcap-extension-to-mime (file-name-extension file)) > + ((and `nil > + (guard (member-ignore-case > + (file-name-extension file) '("md" "markdown")))) > + ;; `mailcap-extension-to-mime' returns nil for Markdown > + ;; files, at least on Emacs 26.3. > + "text/markdown") Here `mailcap-extension-to-mime` could fail if `mailcap` is not yet loaded. Also, the problem you describe seems to depend on /etc/mime.types rather than the version of Emacs. Here (a Debian machine) I got another problem which is that my /etc/mime.types says: [...] application/vnd.lotus-organizer or3 or2 org [...] so I got an error from elpaa--section-to-* complaining that it doesn't know how to convert `application/vnd.lotus-organizer` :-( I think we're going to have to use our own mapping from extensions to types :-( After fixing this problem, I got another one which was in the part that generates the "news" because it calls `elpaa--get-section` but was not updated to adjust to the new return value. I fixed these and made a few other cosmetic changes. You can see the result in the `scratch/prettify-readme.org` branch of elpa.git One thing I noticed in the resulting .html file is that the doc is not clearly delimited any more (e.g. it tends to use

headers for its own top-level entities whereas the surrounding HTML uses

as the header that introduces the doc). :-( Stefan