Html preview tab for markdown
I need to have Html preview tab for my markdown files. What is the best way to do this?
Do i need to export this to HTML and then create a fileEditor, using FileEditorProvider? Or is there a best approach to do this?
请先登录再写评论。
My files for which i need preview is written in markdown. But the extention may not be .md always.
There's a few plugins to help authoring markdown documents, https://plugins.jetbrains.com/search/index?pr=idea&search=markdown
Can you let me know the procedure to add a file template in the intellij plugin?
see com.intellij.ide.fileTemplates.FileTemplateGroupDescriptorFactory, you can find usage examples in Community Sources
I could do this File template.
I added a class which implements FileTemplateGroupDescriptorFactory.
Then I create a class implementing ApplicationComponent, whose initComponent adds a template. Also added these in plugin.xml.
But how do I add another file template? If i add it inside same initComponent, it overwrites the previous template. How do i add multiple file templates?
You don't need ApplicationComponent here. FileTemplateGroupDescriptorFactory is registered via extension point in plugin.xml, see org.jetbrains.idea.devkit.DevKitFileTemplatesFactory in DevKit plugin as example
plugin.xml has :
What does "doesn't work" mean exactly? Did you put <fileTemplateGroup> into proper place in plugin.xml? Any exceptions in idea.log?
Please verify your templates are located under
fileTemplates/j2ee
folder in any of your source roots and template files are actually being copied on 'Make'.
Check community/plugins/devkit/resources/fileTemplates/j2ee as reference for file names, too.
Interrupting again, the only changes i have done are:
plugin.xml
a class implementing FileTemplateGroupDescriptorFactory.
the file templates are as in : (screenshot)
Attachment(s):
Screen Shot 2015-01-16 at 5.28.42 PM.png
your "resources" directoy is not marked as source/resource root
I marked it as resources root. But still no result.
In the devkit usage u told, there is a .html for every .ft file. Is it somthing should be there?
AFAIR description is not required, but highly recommended. Is your plugin's sources available anywhere? This would make debugging much faster.
https://github.com/getgauge/Intellij-Plugin
But this doesnt have the changes pushed related to Live Template.
Works for me after replicating the setup you mentioned here.
Do you see "specs" group in File Templates at all? If yes, please double-check again that production output directory has fileTemplates/j2ee folder with all templates.
What version of IntelliJ are you using? Could you please provide idea.log of sandbox instance?
I use intellij 14.0.1. I can see fileTemplates/j2ee having both the templates i added in production output directory.
But I cannot see the group added in File Templates at all.
Attachment(s):
idea.log.zip
Please try 14.0.3. EAP http://eap.jetbrains.com/idea/
If it still does not work, please provide idea.log from the IntelliJ IDEA instance you use for running your plugin (not the instance you use to develop plugin).
I could get the group displayed in File and Code Templates -> Other tab.
But i cant see this option as the file type when i try to create a new file. Not even this template is used when i create a file with that extention.
But when i place the templates in fileTemplates directory instead of j2ee this works.
Log files attached.
Attachment(s):
idea.log.zip