de-jcup / eclipse-yaml-editor

Eclipse YAML editor
https://marketplace.eclipse.org/content/yaml-editor
Apache License 2.0
34 stars 10 forks source link

Add Support for YAML Frontmatter in Jekyll Files (*.html,*.md,*.markdown) #68

Open mgerzabek opened 5 years ago

mgerzabek commented 5 years ago

Jekyll allows for frontmatter in posts and pages. Frontmatter has to be at the beginning of the file, and starts and ends with three dashes (---). It would be awesome if this editor would be contributed to the standard Eclipse HTML Editor and the Markdown Editor to allow syntax coloring of the frontmatter block.

de-jcup commented 5 years ago

Ahem. I am not sure what you are exactly suggesting. This is a yaml-editor plugin suitable for files normally ending with *.ymlor *.yaml and containing YAML content.

Looking at https://jekyllrb.com/docs/front-matter/ there seems to be always a yaml header block in every jekyl file describing the content in YAML.

Thesis 1

You want to open *.html, *.mdand *.markdown files with yaml editor?

This can be already done in preferences for file associations or with "Open with -> Other ..." context action.

Thesis 2

You want to have the yaml parts rendered inside the origin files.

As far as I know there is no possibility to provide source formatting from one editor into another editor in an embedded way inside eclipse (@vogella : But this would be a nice feature, to let other editors render dedicated parts only ... ).

HTML editor and Markdown editor (which one ?...) are autonomous plugins which have their own source formatting. If you like to have yaml rendering inside them, please contact the owners of these plugins.

mgerzabek commented 5 years ago

Okay. Thanks for the clarification. Thesis 2 is what I meant. I want the yaml parts within .html or .md files to be recognized and highlighted.

WTP is using the Structured Source Editing Component which is by design capable of handling different content partition types within one source file.

The page hints at StructuredTextViewerConfiguration and the Editor Configuration extension point (org.eclipse.wst.sse.ui.editorConfiguration).

AFAIKS third parties are enabled to contribute their work to this extension point to enhance the editing of specified content types, e.g. org.eclipse.wst.html.core.htmlsource when extending the HTML editor.

My eclipse days are faaaaar away, but maybe I can create a pull request…