unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Adam Porter <adam@alphapapa.net>
Cc: emacs-devel@gnu.org
Subject: Re: [ELPA/elpa-admin] Render README.org as HTML with ox-html
Date: Mon, 20 Sep 2021 00:29:09 -0400	[thread overview]
Message-ID: <jwvee9jzzj6.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87o88yuern.fsf@alphapapa.net> (Adam Porter's message of "Sun, 12 Sep 2021 08:03:56 -0500")

> 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 <pkg>.html file is that the doc is
not clearly delimited any more (e.g. it tends to use <h2> headers for
its own top-level entities whereas the surrounding HTML uses <h2> as
the header that introduces the doc).
:-(


        Stefan




  reply	other threads:[~2021-09-20  4:29 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-29 22:52 [ELPA/elpa-admin] Render README.org as ASCII with ox-ascii Adam Porter
2021-08-29 23:28 ` Adam Porter
2021-08-29 23:38 ` Clément Pit-Claudel
2021-08-30  0:01   ` Adam Porter
2021-08-30  1:49     ` Clément Pit-Claudel
2021-08-30  2:15       ` Adam Porter
2021-08-30  0:48 ` Stefan Monnier
2021-08-30  1:29   ` Adam Porter
2021-08-30  2:13   ` [ELPA/elpa-admin] Render README.org as HTML with ox-html Adam Porter
2021-09-03  2:01     ` Adam Porter
2021-09-07  3:31       ` Stefan Monnier
2021-09-07  8:12         ` Philip Kaludercic
2021-09-07 10:26         ` Adam Porter
2021-09-10 20:58           ` Stefan Monnier
2021-09-12 13:03             ` Adam Porter
2021-09-20  4:29               ` Stefan Monnier [this message]
2021-09-20  6:41                 ` Stefan Kangas
2021-09-20 13:40                   ` Basil L. Contovounesios
2021-09-20 19:57                   ` Adam Porter
2021-09-20 23:26                 ` Adam Porter
2021-10-09 15:08                   ` Stefan Monnier
2021-10-09 16:39                     ` Eric Abrahamsen
2021-10-10  3:37                       ` Stefan Monnier
2021-10-10  3:54                         ` Corwin Brust
2021-10-10 13:27                           ` Stefan Monnier
2021-10-10  4:32                         ` Eric Abrahamsen
2021-10-10 14:50                     ` Adam Porter
2021-10-10 15:30                       ` Stefan Monnier
2021-08-30 17:49   ` [ELPA/elpa-admin] Render README.org as ASCII with ox-ascii Philip Kaludercic

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.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvee9jzzj6.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=adam@alphapapa.net \
    --cc=emacs-devel@gnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).