Skip to content
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 for .markdown files #2985

Closed
wesleyboar-fka-iosulfur opened this issue May 6, 2019 · 4 comments
Closed

Markdown Support for .markdown files #2985

wesleyboar-fka-iosulfur opened this issue May 6, 2019 · 4 comments

Comments

@wesleyboar-fka-iosulfur
Copy link

wesleyboar-fka-iosulfur commented May 6, 2019

💬 RFC

I am grateful for Parcel's existing support (and future support in version 2) for Markdown, but it has a defect (ignoring .markdown files) that I do not want to report, because I am taking advantage of that defect to avoid needing the unavailable feature to ignore certain assets.

What should I do?

🔦 Context

I want to link to a Markdown asset, but do not want that asset parsed into an .html file.

The use case is:

  • (optional) I have an established markdown-to-html workflow.
  • I have a direct link to the Markdown asset (for users that want it raw and unfiltered).

I have avoided having the Markdown asset parsed into .html by using the long file extension .markdown instead of the registered filename extension .md.

💻 Examples

<p>Instead, <a href="./timeline.html" target="_blank" title="Timeline (as webpage)">open the timeline directly</a> or <a href="./timeline.markdown" target="_blank" title="Timeline (as document)">download the Markdown file</a>.</p>

If I link to (and name the file) timeline.md, then the timeline.md is parsed as timeline.html.*

* The generated timeline.html, by the way, would overwrite my existing timeline.html from my established markdown-to-html workflow (I tested this). But, this issue is satellite to my primary concern, because I can solve this issue by merely renaming the file or moving it to another directory.

📚 Reference

@VinceOPS
Copy link

Having the exact same issue today! @wesleyboar May I ask you if you ended with a workaround for this? Thanks

@wesleyboar-fka-iosulfur
Copy link
Author

wesleyboar-fka-iosulfur commented Jul 28, 2019

You may. I have thought of three additional workarounds.

  1. I have resolved my specific issue by no longer offering the markdown file for download. I realized that a greater percent of my user base would prefer a link to an unstyled .html page in the browser than to download an unfamiliar extension. 😅

  2. Search issues and docs for an easy way to configure Parcel "ignore" certain files while bundling. Good luck. Configuration is something Parcel ardently avoids.* But, there is progress on the request to tell Parcel to avoid certain link targets since I last referenced it.

  3. Perhaps this is a "long way" to ignore certain files: I believe one can (note, I have not tried, because I no longer have the need) avoid parsing certain files
    by using the Parcel Bundler API. Specifically, I propose, after recreating CLI command via Node script that uses the API, to listen to an event and then cancel or manipulate (if either is possible) the bundling of certain files or directories.

* Configuration (beyond CLI commands) is not provided by Parcel, nor is it likely. This statement is supported by issue discussions that I have read but which I am not convenient to link to (I am typing this message on a phone).

@wesleyboar-fka-iosulfur
Copy link
Author

wesleyboar-fka-iosulfur commented Jul 28, 2019

I am hoping to open a new issue, a proper bug report, not an RFC, about the support for .markdown. So, I will close this issue.

The bug report will likely reuse some of this post. I am not in a hurry to do this, because Parcel 2 is not out, and it seems like all the dev attention is there. And it may be a couple minor versions before the completed markdown support is merged in. (See "Reference" section of original post.)

If someone wants to report it before me (and even reference or use some copy from this issue), then please do.

@VinceOPS
Copy link

VinceOPS commented Jul 28, 2019

Thanks for answering! I actually ended up using .markdown as an extension, a few minutes after asking on this thread, because I noticed that the Markdown parser was only caring for .md.
Thus, I have Parcel bundling my .markdown files, and I'm able to pass their URIs to the lib consuming them. That's "hackish" but will do the job for now 😕.
Sorry for not telling it earlier 🙏

Have a nice day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants