where I can find the `Sample Text File Editor` source code?

I want to develop a plugin that instant rendering for markdown files.


I have read this artcile:  https://confluence.jetbrains.com/display/IDEADEV/Sample+Text+File+Editor

and I think the sample - `Sample Text File Editor` will help me to develop the plugin.

in this paragragh,

"To clarify how to develop your plugin that creates the text editor using the above techniques, consider the textEditor sample plugin available in the <%IDEA project folder%>/community/samples/textEditor> directory. "

I don't know how to find the direcotry of `/community/samples/textEditor`, may be It should be downloaded from some where?

I use Intellij IDEA 14 Ultimate edition and check out the newest source code of Community Edition from git.jetbrains.org/idea/community.git.

10 comments
Comment actions Permalink

Hello,

sources of 'Sample Text File Editor' were obsolete so we removed them from our repository. Until we provide up-to-date samples for these topics you
can use other open-source plugins as a reference. E.g. you can look at idea-markdown plugin (https://plugins.jetbrains.com/plugin/5970?pr=idea), its
sources are available on GitHub (https://github.com/nicoulaj/idea-markdown). It looks like it supports preview for markdown files, see
MarkdownPreviewEditor class
(https://github.com/nicoulaj/idea-markdown/blob/master/src/main/java/net/nicoulaj/idea/markdown/editor/MarkdownPreviewEditor.java).

--
Nikolay Chashnikov
JetBrains
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

thank you for your reply.

I have used `idea-markdown` to highlight and preview markdown files in Intellij IDEA. but, some cool feature was missing in `idea-markdown` plugin.

First, It don't support GitHub Flavored Markdown.
Second, I want to instantly preview markdown files like this vim plugin, https://github.com/suan/vim-instant-markdown .

I think may be I can:

  1. add a event listener when I press a key in the file editor, and run system command  `curl` to post the file content to a server.
  2. the server will keep a socket connection with a browser, so I can push the new html content to the browser.


the api about 1. may be located in the community edition source tree:
`platform/platform-api/src/com.intellij/openapi/editor`
or
`platform/platform-api/src/com.intellij/openapi/fileEditor`

I don't know very much about Intellij IDEA plugin development.
Many of docs are outdated, to find the useful information about this is like to look for a needle in a haystack.

0
Comment actions Permalink

Hi Xp Xp,

For the live preview, what you're suggestion sounds awefully complex. Why not do it like in my AsciiDoc plugin? (check the animated gif!) https://github.com/bodiam/asciidoctor-intellij-plugin

Secondly, you're very right about the plugin development. In fact, I made an issue about it here: https://youtrack.jetbrains.com/issue/IDEA-132998, and JetBrains is working really hard to improve the documentation, the process and the tools to make the plugin development much easier to do.

Hope that helps!

Erik

0
Comment actions Permalink

Many of docs are outdated,

Could you be more specific and list which ones you encountered, please?

0
Comment actions Permalink

thank you for your reply.

AsciiDoc plugin is great! I have checked out the plugin source from github yesterday.

AsciiDoc use JEditorPane to render html content, the big advantage is the preview window is fully integrated in Intellij IDEA, so I can edit document without leaving the Intellij IDEA.

But AsciiDoc plugin have some rendering bug, if you have an image in you AsciiDoc document, the image flicker in the preview window when your are typing,  it is really annoying. for example, https://github.com/bodiam/asciidoctor-intellij-plugin/blob/master/README.adoc  

I like the extensibility of browser (for example, chrome). Browsers render the html very well.

Maybe I can develop my plugin base on the AsciiDoc plugin. Thank you very much :)

0
Comment actions Permalink

yannc76 wrote:

Many of docs are outdated,

Could you be more specific and list which ones you encountered, please?


for example:

https://confluence.jetbrains.com/display/IDEADEV/Sample+Text+File+Editor
To clarify how to develop your plugin that creates the text editor using the above techniques, consider the textEditor sample plugin available in the <%IDEA project folder%>/community/samples/textEditor> directory.

https://confluence.jetbrains.com/display/IDEADEV/Getting+Started+with+Plugin+Development

<action id="Myplugin.Dialogs"
 
class="Mypackage.MyShowDialog"
 
text="Show _Dialog"
 
description="A test menu item"
 
/>

0
Comment actions Permalink

I'm the author of the plugin, and I wasn't aware of such a bug. I'll take a look, thanks for reporting.

0
Comment actions Permalink

this attachment is a screencast gif to illustrate the rendering bug.



Attachment(s):
asciidoc.gif
0
Comment actions Permalink

So what exactly is outdated about the second item? It's a valid example showing how to register an action in plugin.xml.

0
Comment actions Permalink

the code of `Mypackage.MyShowDialog` was lost in the document.


when you try to run this demo, you will get error message like this:

[  12112]  ERROR - ctionSystem.DefaultActionGroup - class with name "Mypackage.MyShowDialog" not found [Plugin: com.yourcompany.unique.plugin.id]
com.intellij.diagnostic.PluginException: class with name "Mypackage.MyShowDialog" not found [Plugin: com.yourcompany.unique.plugin.id]

0

Please sign in to leave a comment.