dillionmegida / gatsby-remark-liquid-tags

📍 A template plugin used for custom embeds in markdowns.
MIT License
10 stars 5 forks source link

eliminate switch case #7

Open muescha opened 4 years ago

muescha commented 4 years ago

Please describe the feature you'd like:

Suggested Implementation

create a map with embedders and then you can just grab the formatter from a map like

const embedder = embedders[tagName];
if(!embedder) return;
let embed = embedder(tagOptions);

you can use for example require-dir-all then each embed plugin can register itself in a embedders map

or just a manual created map

dillionmegida commented 4 years ago

Can I see an example, please?

I understand where you're heading to but I don't really understand your suggested implementation.