agora-org / agora

File server that accepts Lightning Network payments for downloads
Creative Commons Zero v1.0 Universal
184 stars 26 forks source link

Render *.md files as Markdown #294

Closed yzernik closed 2 years ago

yzernik commented 2 years ago

I noticed that the .index.md file gets rendered as Markdown on the directory page.

Is there any reason why we don't render all .md files as Markdown?

casey commented 2 years ago

We wouldn't want to make it impossible to sell raw markdown files. I.e. if we rendered markdown server-side, clients wouldn't be able to get the markdown source. Another thing is that you can always create more pages with .index.md files in them, if you want to create a tree of rendered pages.

Do you have a use-case in mind?

yzernik commented 2 years ago

I was thinking about using Agora as a blog engine. Have a folder called "blog" with a bunch of .md files in it. Then anyone could read them directly right after payment.

I'm not sure if that fits with the intended purpose of Agora, but just an idea.

yzernik commented 2 years ago

Your explanation makes sense. I wonder if there is any way to render Markdown on the client side. Then people could get the source file and also read the file in a user-friendly format.

casey commented 2 years ago

I was thinking about using Agora as a blog engine. Have a folder called "blog" with a bunch of .md files in it. Then anyone could read them directly right after payment.

Ah, okay, so the idea is that you want to write pages in markdown, and allow people to pay to access the rendered content?

One way to do this would be to render the markdown once, i.e. with a static site generator, and then charge to access the rendered HTML.

yzernik commented 2 years ago

That makes sense. HTML is what I will use.

casey commented 2 years ago

Okay, sweet.