Re: bozohttpd mime types etting for markdown files

2019-05-28 Thread Mayuresh
On Tue, May 28, 2019 at 12:02:04PM +0200, Andreas Krey wrote:
> I wouldn't expect browsers to have markup processors.

Ok. I was expecting that, but it's the servers that are doing the tricks.

BTW I have used latex as a markup language to produce some simple
websites, meant for documentation / information dissemination. I know
htlatex has limitations, but for my purpose it's good enough. I thought
md would be fit for that purpose as well, just with a simpler notation.
But looks like I will need an md2html converter anyway. I might as well
stick to latex in that case.

Any other thoughts?

Mayuresh


Re: bozohttpd mime types etting for markdown files

2019-05-28 Thread Andreas Krey
On Tue, 28 May 2019 14:28:26 +, Mayuresh wrote:
...
> Clicking on a .md file in, for example, a git repository renders it
> instead of asking to save.

I assume that is not the rendering of just the plain file
but also include navigation elemets around it? Like
https://gitweb.torproject.org/tor.git/tree/doc/HACKING/Maintaining.md does?
There the entire page is delivered as one html document.

> Or may be my expectation is wrong and is a web server supposed to convert
> it to html on the fly?

That depends on your expectation of what the server does in turn.
I wouldn't expect browsers to have markup processors.

- Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds 
Date: Fri, 22 Jan 2010 07:29:21 -0800


Re: bozohttpd mime types etting for markdown files

2019-05-28 Thread Martin Husemann
On Tue, May 28, 2019 at 02:28:26PM +0530, Mayuresh wrote:
> Or may be my expectation is wrong and is a web server supposed to convert
> it to html on the fly?

Github renders it as html (AFAICT).
You can check details in the debugger (F12), in network view.

Martin


Re: bozohttpd mime types etting for markdown files

2019-05-28 Thread Martin Husemann
On Tue, May 28, 2019 at 01:27:56PM +0530, Mayuresh wrote:
> On Tue, May 28, 2019 at 09:33:12AM +0200, Martin Husemann wrote:
> > So your example should be correct, assuming you put the single quotes only
> > in the mail and not on the command line (or into inetd.conf). This needs
> > to be 5 args to the server.
> 
> I am using /etc/rc.conf
> 
> httpd_flags="-M md text/markdown - -"
> 
> (and many trials there after -M as mentioned).
> 
> I do not know how much role the browser is playing. Tried only firefox
> till now. It just offers to save the file and says it's a markdown file.

Sounds like it is working?

Martin


Re: bozohttpd mime types etting for markdown files

2019-05-28 Thread Mayuresh
On Tue, May 28, 2019 at 09:33:12AM +0200, Martin Husemann wrote:
> So your example should be correct, assuming you put the single quotes only
> in the mail and not on the command line (or into inetd.conf). This needs
> to be 5 args to the server.

I am using /etc/rc.conf

httpd_flags="-M md text/markdown - -"

(and many trials there after -M as mentioned).

I do not know how much role the browser is playing. Tried only firefox
till now. It just offers to save the file and says it's a markdown file.

Mayuresh


Re: bozohttpd mime types etting for markdown files

2019-05-28 Thread Martin Husemann
On Tue, May 28, 2019 at 12:27:00PM +0530, Mayuresh wrote:
> The man page says:
>  -M suffix type encoding encoding11
> Adds a new entry to the table that converts file suffixes to
> content type and encoding.  This option takes four additional
> arguments containing the file prefix, its ?Content-Type?,
> ?Content-Encoding?, and ?Content-Encoding? for HTTP/1.1
> connections, respectively.  If any of these are a single dash
> (?-?), the empty string is used instead.
> 
> Tried '-M md text/markdown - -' and variations like .md instead of md,
> utf-8 instead of - etc.
> 
> What is a proper way to specify this?

I didn't try markdown but I have:

-M .js "script/javascript" - -

(plus a few other -M options) and it seemed to work for me last I tested.

So your example should be correct, assuming you put the single quotes only
in the mail and not on the command line (or into inetd.conf). This needs
to be 5 args to the server.

Martin


bozohttpd mime types etting for markdown files

2019-05-28 Thread Mayuresh
The man page says:
 -M suffix type encoding encoding11
Adds a new entry to the table that converts file suffixes to
content type and encoding.  This option takes four additional
arguments containing the file prefix, its “Content-Type”,
“Content-Encoding”, and “Content-Encoding” for HTTP/1.1
connections, respectively.  If any of these are a single dash
(“-”), the empty string is used instead.

Tried '-M md text/markdown - -' and variations like .md instead of md,
utf-8 instead of - etc.

What is a proper way to specify this?

Mayuresh