jtojnar / markdown-image-insertion

Atom extension for quick insertion of many images into markdown document
https://atom.io/packages/markdown-image-insertion
MIT License
0 stars 0 forks source link

Support multiple templates #3

Open jtojnar opened 4 years ago

jtojnar commented 4 years ago

Despite the name, the extension supports more then just inserting markdown. You can configure the used template completely through the following settings:

For example, some people use it for LaTeX: https://github.com/jtojnar/markdown-image-insertion/issues/2#issuecomment-642991501

It might be nice to allow having multiple profiles and allow users to choose one of them. Or at least supporting per-project/per-language settings might be nice. Found this https://blog.atom.io/2014/10/31/language-scoped-config.html#using-in-your-own-packages

jaysnoddy commented 4 years ago

for my use, I would prefer NOT having output decided by initial language. The simpler option (I assume) of letting the user decide at time of inserting image link would be better for me. I could see, though, how some may want automated-by-language option.

I use multiple language export blocks in markdown, as I cannot get captions, ALT text for sight-impaired, formatting, etc. to work by just exporting simplified markdown. BTW, thanks for this great extension!

jtojnar commented 4 years ago

I was thinking more like allowing users to override the option per-language as described in https://blog.atom.io/2014/10/31/language-scoped-config.html#using-in-your-own-packages since I think it provides good enough flexibility for most use cases while keeping the user interface simple.

It would be even better if atom allowed passing parameters to commands so that users could define their custom shortcuts like

'atom-text-editor':
    'ctrl-shift-i l':
        'command': 'markdown-image-insertion:insert-images'
        'params':
            'imageCode':
                |\begin{{figure}} \centering  \includegraphicswidth=0.95\textwidth]{url}
                |\caption{{CAPTION
                |\\  \footnotesize
                |Credits:  
                |\normalsize }}
                |\end{{figure}}
            prologue: |~~~{=latex}
            epilogue: |~~~

or add new menu items but it appears there is no elegant way to do that (https://discuss.atom.io/t/parameters-in-atom-commands/67355),