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?

0

My files for which i need preview is written in markdown. But the extention may not be .md always.

0

Can you let me know the procedure to add a file template in the intellij plugin?

0

see com.intellij.ide.fileTemplates.FileTemplateGroupDescriptorFactory, you can find usage examples in Community Sources

0

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?

0

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

0
But this doesnt work:

public class SpecificationLiveTemplate implements FileTemplateGroupDescriptorFactory {
    @Override
    public
FileTemplateGroupDescriptor getFileTemplatesDescriptor() {
        
        FileTemplateGroupDescriptor descriptor = new FileTemplateGroupDescriptor("Specs", SpecIcon.FILE_ICON);
        descriptor.addTemplate(new FileTemplateDescriptor("specTemplate.spec", SpecFileType.INSTANCE.getIcon()));
        descriptor.addTemplate(new FileTemplateDescriptor("conceptTemplate.cpt", ConceptFileType.INSTANCE.getIcon()));
        return descriptor;
    
    }
}


plugin.xml has :

 
<fileTemplateGroup implementation="com.abc.xyz.core.SpecificationLiveTemplate"/>
 
0

What does "doesn't work" mean exactly? Did you put <fileTemplateGroup> into proper place in plugin.xml? Any exceptions in idea.log?

<extensions defaultExtensionNs="com.intellij">
<fileTemplateGroup ..../>
</extensions>
0
 
Yes, its inside:
 
<extensions defaultExtensionNs="com.intellij">
 
..
 
</extensions>
  
Doesnt work mean that, the template is not added to File Templates in preferences.
0

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.

0

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
0

your "resources" directoy is not marked as source/resource root

0

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?

0

AFAIR description is not required, but highly recommended. Is your plugin's sources available anywhere? This would make debugging much faster.

0

https://github.com/getgauge/Intellij-Plugin

But this doesnt have the changes pushed related to Live Template.

0

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?

0

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
0

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).

0

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
0

请先登录再写评论。