How to get Smarty Template Highlighting in Zend Studio 9? - macos

I am trying to find a way to get smarty templates, .tpl files, to work with Zend Studio 9. The smartypdt plugin fails to install on Mac OS, and all the other File Associations--I have tried PHP Editor and HTML as associated editor--fail, too. This time stating: "Unsupported content type in editor". So all I am left with is a plain text mode.
How do I get basic template highlighting? I do not necessarily want smarty support anymore, just basic HTML and JavaScript highlighting would be enough.

On the File Associations Panel, there is a link to Content Types. There, I have added *.tpl file to the HTML view node. This ensures basic html highlighting and goes a long way when compared to the plain text mode.

Related

HTML highlighting in ATOM dysfunctional when using ZURB Foundation Template Engine Syntax

Im new to ZURB Foundation 6 and its Foundation CLI. Using the template engine works like a charm though, except for the syntax highlighting so far.
Here is a screenshot:
https://imgur.com/P1MCv3X
As you can see, highlighting the beginning and end of an HTML Element doesnt work anymore when Im using the template engine syntax with the double brackets. The site works perfectly, so this erroneous interpretation of the HTML structure is a problem of the editor.
Is there any way to work around this issue in ATOM? Or do I have to live with it?
When you're using a templating engine such as Handlebars (which ZURB seems to use), you need to install a language syntax for that. There are several available, you need to find out for yourself which one works best for you.
Once installed, you either need to work with .hbs files for automatic detection, or you have to specify the syntax manually by clicking on the dialog that reads "HTML" on your screenshot (in the bottom right).

How Visual Studio syntax highlight works?

When I create a tag 'style' in an aspx page, Visual Studio highligths code using css style syntax to highlights and formatting. When I create a tag 'script', Visual Studio does the same, but using javascript style syntax.
When I create a .scss file, Visual Studio has scss syntax. I created a new server control that processes SCSS, and I want that code wrote inside this server control use scss style syntax. How do I vinculate a certain tag to a certain syntax processor?
Ps.: I'm using Visual Studio 2017
Editors (and many editor related features) in VS rely on a Content Type which indicates the language they support. Most editors, like C# or VB, only work on a single Content Type.
The HTML and ASPX editors in Visual Studio (which are separate editors) identify certain patterns that indicate a different language is being used. It then creates multiple internal documents in memory (TextBuffers) with separate Content Types for each language identified. The language services for each of those can then be used to handle the language natively instead of HTML having to "know" all about CSS/JavaScript/anything else. For example:
<script> blocks or event handlers create a JavaScript buffer for the contents
<style> blocks or style= attributes create CSS buffers
Any of the <%-style ASP.NET nuggets create appropriate language buffers (C#/VB)
The # in Razor CSHTML files creates a C# buffer
etc
These nested TextBuffers are actually entire documents to make the language look right. For example, if I have:
<span style="color: blue;" />
The CSS buffer is an internal document that looks something like this:
/* BEGIN EXTERNAL SOURCE */
span {
color: blue;
}
/* END EXTERNAL SOURCE */
It's important to note that this is a complete and parseable CSS document, so the language service can work as normal for finding errors, giving IntelliSense, etc.
(And if you think the CSS buffer looks messy, you should see what happens for Razor or ASPX nuggets...)
The ASPX editor then uses the VS editor platform to coordinate projections between these buffers into the single view of what you see - a TextView. So it looks like a single document, but it's being handled internally as several different documents (TextBuffers), one per language.
Now, getting to your question: how can you make the ASPX editor support SCSS? Well, there are two parts to this:
First, the ASPX editor would need to know how to identify the SCSS region of the document. This might be <style type="text/scss"> or another indicator. This could even be done by writing an extension to the ASPX editor if it were extensible (the HTML editor is much more friendly to writing extensions).
Next, the ASPX editor would create the projection span. It would hand that off to the SCSS language service. The SCSS language service needs to know that it's in a projection, and generate all that extra stuff to make the syntax tree work. (Note: the SCSS language service in VS doesn't support this today.)
From then on, everything that happens in the SCSS region needs to be mapped between the TextView (where the cursor is in the document you see) to the SCSS-specific TextBuffer (where the cursor is in the in-memory document used by the language service). Again, today the SCSS LS does not take this scenario into account.
The best way to get this to be supported is to give feedback through the Visual Studio developer community. This feature is already on the backlog, but adding additional votes for it will help the team to prioritize the work.

Komodo Edit 8 doesn't recognize Django tags for HTML5 pages

I am using Komodo Edit 8 for a Django project. HTML5 pages do not recognize django template tags for syntax highlighting or code intelligence. However, HTML pages do accurately recognize these tags. Is there a setting that can be adjusted? Can I just make all HTML5 pages be recognized as only an HTML page?
It appears to me that .html files that are snippets are recognized as HTML (4) and .html files that contain the <html> tag are recognized as HTML5.
I found this StackOverflow page, but the answer does not correct my problem
My Komodo build is:
Komodo Edit, version 8.0.2, build 12590, platform linux-x86_64
Well, that was a total noob question. The answer is simple. To solve, switch the file type from "HTML5" to "Django" using the selector on the status bar at the bottom of the application.

Integrated Markdown WYSIWYG text editor

In looking for a straightforward WYSIWYG editor for Markdown code, I am not finding a comparible UI to that of CkEditor, TinyMCE, ect.
Specifically, the Markdown "WYSIWYG" editors that are often recommended (such as posts like this ) are not pure WYSIWYG editors in the sense that users either still write raw Markdown ( MarkItUp ) or go to the other extreme of having in-line editing without standard controls ( Hallo ).
I need something in-between.
I'm looking for a Markdown editor that looks and functions like a stripped down CkEditor text box, and that accepts and outputs Markdown. There should be a toolbar with a minimum set of formatting options (B, I, U, lists, ect), and the text entry area should show the converted Markdown, not the raw code. There should be a Source button that will allow users to edit the raw Markdown, but even that is optional. Ex:
I get the reason for Markdown/wiki, ect - the security it offers. I don't mind entering raw code like here at SE, but my users are not geeks and do not find this enjoyable. They don't want to see * * * ___ and spaces mixed in with their text. They are used to "Word" style editing, and are most productive in that environment.
So - is there a truly integrated WYSIWYG editor for Markdown? I'm writing in a PHP, so something that I can invoke with a class would be perfect.
Sept 23, 2015 Update
CKEditor now has a Markdown addon that does this exact thing. The addon project is hosted on github.
Screenshots:
Apr 13, 2015 Update
Someone professing to develop CKEditor says that the appearance of CommonMark is a game changer, and we could possibly see a proper markup interface for CKEditor (read comments for the full story).
Feb 6, 2015 Update
CKEditor now comes with a plugin that outputs (and accepts as input) BBCode.
Demo: http://ckeditor.com/demo#bbcode
SimpleMDE, a newcomer, may be the answer. I've been searching for something just like this for a month now. I'm surprised that this does not show up higher in search results. I had to go through a notice on lepture/editor to find this.
I was researching in this subject the other day and I haven't found any decent WYSIWYG editor with Markdown output. In fact, first you have to have to create a WYSIWG Markdown editor is WYSIWG HTML editor and there are just few of them that are usable on the market.
There's a chance that you'll be able to create dataProcessor for CKEditor that will change HTML editor into Markdown editor. We've got a plugin for BBCode that works like this (check out http://nightly-v4.ckeditor.com/3737/samples/bbcode.html).
All you have to do is implement this interface http://nightly-v4.ckeditor.com/ckeditor_api/#!/api/CKEDITOR.dataProcessor. If you check BBCode plugin's code you'll see some hacks and tricks, because unfortunately current CKEditor's architecture isn't ready (yet) to create such a data processor. However, I believe that if you want to provide only few styling options you should be able to implement Markdown support pretty quickly.
EDIT Sept 23, 2015
CKEditor now has a Markdown addon that does this exact thing. The addon project is hosted on github.
Screenshots:
As posted in my Feb 6, 2015 update, CKEditor now includes plugins that allow BBCode input and output.
A demo is available here: http://ckeditor.com/demo#bbcode
EDIT Apr 13, 2015:
Someone professing to develop CKEditor says that the appearance of CommonMark is a game changer, and we could possibly see a proper markup interface for CKEditor (read comments for the full story).
Pen is a new (active as of 2014) WYSIWYG editor that outputs Markdown.
It's not perfect—I've had issues with pasting HTML there—but it works.
Edit: Sorry! It doesn't output Markdown. Walery Strauch pointed out in the comments that the Markdown formatting signs I saw were actually CSS pseudo element rules:
Still, I'll leave it here as an option since some people upvoted this answer and it may have been of use to somebody.
I implemented a very simple editor that allows the contents of a <textarea> that contains Markdown to be edited in a WYSIWYG fashion.
I used Hallo. I don't think its web site makes it obvious that it is not itself a Markdown WYSIWYG editor but the demo does forge the path to one.
Hallo allows WYSIWYG editing of the HTML inside a <div>. I used javascript to hide any <textarea> blocks that have a specific wysiwyg CSS class, replacing it with a <div> and copying the contents of the <textarea> into the <div>. The copying runs through Showdown which produces HTML from Markdown.
Another Javascript routine reacts every time the <div> contents change. It copies the contents back into the (now hidden) <textarea>. The content is run through to-markdown to convert from HTML to Markdown.
If the <textarea> is a field in a <form>, then the edited Markdown will be sent to the server when that form is submitted.
The inspiration for this comes from the Hallo Markdown Example, specifically the editor.js file. I used that as a basis for my own script along with hallo.js, showdown.js and to-markdown.js.
My script, wysiwyg.js is a derivative of editor.js from the Hallo Markdown Example. Some points to note:
I use this in a Rails application (not that that matters)
It runs on ready and also on page:load, the latter because Rails uses Turbolinks
It runs on ajaxComplete because I use Ajax for form error reports
There are other dependencies: JQueryUI and Rangy (Rails users can avail of the gems jquery-ui-rails and rangy-rails).
Also Font Awesome is used for the tool bar icons. The version of hallo.js used by the demo is out of date (it uses an old version of Font Awesome) - use hallo.js from GitHub instead.
You only need to add CSS class='wysiwyg' to any <textarea> to enable WYSIWYG on it. The <textarea> should conain Markdown formatted text.
I would expect that wysiwyg.js could be easily adapted to use another editor if you don't like Hallo as long as it works on the HTML in a <div>. There are quite a few to choose from but not all are as lightweight as Hallo.
A smilar piece of work that I found is markdown-html-form. It uses the same Showdown and to-markdown.
I am also looking for a markdown editor that is described at the top of this thread
Have you seen "markdown tools": http://md-wysiwyg.sourceforge.net/
Demo: http://md-wysiwyg.sourceforge.net/cgi-bin/cgi_wysiwyg_test.py/
That seems pretty close to what we are looking for, it does a reasonable job of taking your WYSIWYG rich text and outputting markdown. However it failed on an encoding exception when I pasted in some rich text from a google doc.
I found two which currently seem to be quite popular, active and free but haven't been mentioned yet.
The first one is Toast UI Editor. It supports both modes (WYSIWYG and raw). It has official react and vuejs wrappers.
The second one is ProseMirror which calls itself "a toolkit for building rich-text editors on the web" and it seems to be very flexible and extensive. It also supports both modes.
I'm pretty sure solid unofficial react / vue / angular wrappers for it can be found as well.

How can I revert back the native javascript code coloring in Dreamweaver CS4?

I recently installed Adobe Dreamweaver CS4. When I tried to code in javascript, all my code is written in pink font. I checked my Preferences > Code Coloring then choose Javascript. I was surprised to see that it only recognizes 3 types of code: jQuery Identifiers, jQuery Keywords and Methods, jQuery objects. I do code jQuery, but I want to see the previous color coding from my pass Installation (Macromedia Dreamweaver version XX). What can I do to revert or add these native code types so I can set their syntax color. I'm just used to seeing these codes more color-coded. Thanks in advance!
I ask because I have the following options when I open up the JavaScript code coloring options:
JavaScript Bracket
JavaScript Client Keywords
JavaScript Comment
JavaScript Default Text
JavaScript Function Keyword
JavaScript Identifier
JavaScript Native Keywords
JavaScript Number
JavaScript Operator
JavaScript RegExp
JavaScript Reserved Keywords
JavaScript String
I just checked in CS4 and CS5 and those entries are present in both, there are no entries for jQuery. Have you installed an extension that provides jQuery support (at least code coloring)? If you have, then I'd suggest you uninstalling it and the modifications may be reverted.
If you have uninstalled the extension, or if you don't have an extension installed, and the code coloring is still awry, to get back to the original code coloring that's built into Dreamweaver, you may need to perform step 12 on this page:
http://kb2.adobe.com/cps/191/tn_19105.html
For CS4 and CS5, the folder to remove will have a "language" folder that the Configuration folder is within. On my Vista system for CS5, it's at:
C:\Users[username]\AppData\Roaming\Adobe\Dreamweaver CS5\en_US\configuration\

Resources