Le 21/10/2025 à 00:49, Ralph Ronnquist via Dng a écrit :
> On Mon, Oct 20, 2025 at 04:36:56PM +0200, Didier Kryn wrote:
>> Hello guys.
>>
>> I'm confused with markdown files. Essentially I'm concerned with
>> README.md like one can find in any git store, like git.devuan.org.
>>
>> 1) If I write a file in the Markdown format, my browser doesn't know how
>> to display it.
>>
>> 2) If I point my browser to the same file through a server at localhost,
>> it still can't display it.
>>
>> 3) If I point the same browser to some README.md file in the git store,
>> now it can display it.
>>
>> 4) If I look at the content of the README.md file, it is just plain
>> HTML!
>>
>> Is somebody lying, or is there some mechanism in the servers which
>> convert md to html, or what else?
>>
>> Thanks if one can explain.
> It's unfortunate it makes you confused, but the Devuan git store (like
> most git stores) performs server side html rendering of a number of
> file types, including .md and .adoc, to present them "as rendered". In
> fact all files are presented in *some* rendering because the tool like
> to add menus and buttons and things around the "raw" file content. E.g
> when you view a .png file in the git store, it will end up rendered as
> an image rather than than showing the bytes of the file; when you view
> a .sh file you'll see the content infused with coloring, etc.
>
> Most rendered presentations include a "raw" button for the server to
> publish the file content in "text/plain" form, and even then you will
> find that your browser creates an html structure where the file
> content is wrapped with a "<pre>" tag.
>
> Afaik for Devuan's git store, .md failes are rendered with "markdown"
> from the package with same name, and -adoc files are rendered with
> "asciidoctor" from the package.
Thanks to all for the usefull hints. And, you, in particular, who
gave the ultimate explanation I was looking for. Actually, after asking
the question, I had continued looking for the answer by myself and
devised that the Markdown file was sent embedded into an HTML file
containing a script to interpret and "render" it. And I've also seen
that git.devuan.org makes it possible to open the original document.
The browsers cannot render a .md file when I open it with a URL
like "
File:///home...", or with just the filename on the command-line.
They could not when pointing to it through with my own server at
localhost, either, because it didn't know this file extension and would
send the file with the type application/octet-stream. I modified it so
as to send it as text/markdown, and here are the results with my two
browsers:
- Palemoon now suggests to open it with Emacs, which is not so bad,
because Emacs has a Markdown mode.
- Firefox displays it as plain text, which is a fair falldown.
The difference certainly reflects different configurations.
There remains the problem of verifying the correctness of a
markdown file, but there are severall tools for that, as mentionned by
the people who replied to my question -- thanks again.
-- Didier