New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdown Support #2274
Comments
Hi, I think it's a cool idea for Parcel to treat Markdown files as entry points. It could compile Markdown into HTML and then do whatever it does to HTML. I think it's not going to be hard to implement. However, you mentioned layouts and front matter. In my opinion, Parcel shouldn't invent its own templating system for Markdown, so we'd have to use an existing solution. @LandonSchropp Can you think of an existing tool that already does that — wraps a compiled Markdown file into an HTML template and forwards the attributes from the front matter to that template? @DeMoorJasper If such a tool as described above existed and seemed to be actively maintained, so you think it's a good idea to build it into Parcel? |
I couldn't find something like that by myself. 🤷♂️ Maybe we could indeed use a templating language like Pug or Mustache. With Mustache, a layout would look like this: <html>
<head>
<title>{{title}}</title>
</head>
<body>
<div class="blog-post">
{{{markdown_content}}}
</div>
</body>
</html> Markdown file: ---
title: "How to be"
layout: "./layout.html"
---
regular *markdown* here |
@kirillrogovoy Sorry, I missed your previous question. I don't know of any tools that do this currently with Parcel. Outside of Parcel, it's pretty common in the static site generator world. Here's an example from Jekyll and here's one from Middleman. In my current project, I use Gulp to extract the front matter, compile the markdown to HTML, inject the template and then recompile in the templating language.
|
I see. I'm going to hack together some experimental version of that keeping it as simple as possible. |
Markdown support was added by #2538 in version 1.12.0. |
🙋 Feature Request
I'd love to see markdown added to Parcel.
🤔 Expected Behavior
Ideally, I could create files with a
.md
extension, runparcel serve source/posts/*.md
and I'd be done.I'd also expect to be able to specify some kind of layout file for my Markdown. Most static site generators I've seen use front matter for this:
😯 Current Behavior
Currently, this doesn't seem to be supported in Parcel core. There are two plugins, parcel-plugin-markdown and parcel-plugin-md, but they don't really work how I'd expect them to.
💁 Possible Solution
I think it makes a ton of sense to add markdown support to Parcel directly.
🔦 Context
I really want to build a small static blog with Parcel. However, without Markdown support, this is extremely hard to do. Creating blogs that can be hosted on places like GitHub pages is very handy, and will be even more so once GitHub Actions launches to the public.
💻 Examples
The Parcel website repository uses a different generator to handle its Markdown.
The text was updated successfully, but these errors were encountered: