G'day,
The following can be tacked onto the end of the html keywords line in filetypes.xml for the HTML5 new elements to be recognised:
article aside audio canvas command details datalist figure figcaption footer header hgroup keygen mark meter nav output progress section time video wbr
What would be quite nice is to be able to have different modes for HTML/XHTML to allow for the defined keywords of each doctype to be recognised as appropriate, e.g. HTML <=4 and XHTML won't know what a canvas is so it should appear as an error in those doctypes, and HTML5 won't know what center is (which is just as well because it's misspelled in all but Wronglish :)
Admittedly that's a bit of a tall order, and I have no clue where to start -- but I might sit on it as a possible plugin someday. If somebody just happens to sort it out sooner, I reckon there'd be quite a few happy people about the place!
cheers, Ross
On Fri, 22 Oct 2010 23:46:08 +1100 Ross McKay rosko@zeta.org.au wrote:
The following can be tacked onto the end of the html keywords line in filetypes.xml for the HTML5 new elements to be recognised:
article aside audio canvas command details datalist figure figcaption footer header hgroup keygen mark meter nav output progress section time video wbr
Done, thanks.
What would be quite nice is to be able to have different modes for HTML/XHTML to allow for the defined keywords of each doctype to be recognised as appropriate, e.g. HTML <=4 and XHTML won't know what a canvas is so it should appear as an error in those doctypes, and HTML5 won't know what center is (which is just as well because it's misspelled in all but Wronglish :)
Not sure about HTML5, but it might be nice to have a separate XHTML filetype. I don't know if making a custom filetype would work but it might be worth investigating if you like:
http://www.geany.org/manual/dev/index.html#custom-filetypes
Nick
On 23 October 2010 03:56, Nick Treleaven nick.treleaven@btinternet.com wrote:
On Fri, 22 Oct 2010 23:46:08 +1100 Ross McKay rosko@zeta.org.au wrote:
The following can be tacked onto the end of the html keywords line in filetypes.xml for the HTML5 new elements to be recognised:
article aside audio canvas command details datalist figure figcaption footer header hgroup keygen mark meter nav output progress section time video wbr
Done, thanks.
What would be quite nice is to be able to have different modes for HTML/XHTML to allow for the defined keywords of each doctype to be recognised as appropriate, e.g. HTML <=4 and XHTML won't know what a canvas is so it should appear as an error in those doctypes, and HTML5 won't know what center is (which is just as well because it's misspelled in all but Wronglish :)
Not sure about HTML5, but it might be nice to have a separate XHTML filetype. I don't know if making a custom filetype would work but it might be worth investigating if you like:
http://www.geany.org/manual/dev/index.html#custom-filetypes
Nick
Hi Ross, Nick,
The problem I see is identifying the filetype, lots of (most?) xhtml tools generate files with the .html extension so you would have to read the file contents to identify it. IIUC custom filetypes only use the extension not the contents. And I expect HTML5 would have the same problem.
Making them built in filetypes would allow the filetypes_detect_from* functions to be extended to distinguish the filetype.
Cheers Lex
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Am Samstag, den 23.10.2010, 10:49 +1100 schrieb Lex Trotman:
On 23 October 2010 03:56, Nick Treleaven nick.treleaven@btinternet.com wrote:
On Fri, 22 Oct 2010 23:46:08 +1100 Ross McKay rosko@zeta.org.au wrote:
The following can be tacked onto the end of the html keywords line in filetypes.xml for the HTML5 new elements to be recognised:
article aside audio canvas command details datalist figure figcaption footer header hgroup keygen mark meter nav output progress section time video wbr
Done, thanks.
What would be quite nice is to be able to have different modes for HTML/XHTML to allow for the defined keywords of each doctype to be recognised as appropriate, e.g. HTML <=4 and XHTML won't know what a canvas is so it should appear as an error in those doctypes, and HTML5 won't know what center is (which is just as well because it's misspelled in all but Wronglish :)
Not sure about HTML5, but it might be nice to have a separate XHTML filetype. I don't know if making a custom filetype would work but it might be worth investigating if you like:
http://www.geany.org/manual/dev/index.html#custom-filetypes
Nick
Hi Ross, Nick,
The problem I see is identifying the filetype, lots of (most?) xhtml tools generate files with the .html extension so you would have to read the file contents to identify it. IIUC custom filetypes only use the extension not the contents. And I expect HTML5 would have the same problem.
It's at least a nice idea to detect this from the content if the file contains a DOCTYPE directive. The keywords may be actually read from the document type definition itself, then (e.g. [1]). But since this is very special for (X)HTML, it may be better implemented in a plugin.
Also, that wouldn't work for cases, where parts of HTML files are included into an index file and just the index file contains the doctype directive. I'm doing this often, that I include files via PHP include() function or SSI #include. plugins.geany.org is an example for that. In this case I tend to say, let's just configure the (X)HTML version written by project settings under Project->Properties Menu. Maybe a plugin could add a new tab there? :)
Best Regards, Dominic
[1] http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
Dominic Hopf wrote:
It's at least a nice idea to detect this from the content if the file contains a DOCTYPE directive. The keywords may be actually read from the document type definition itself, then (e.g. [1]). But since this is very special for (X)HTML, it may be better implemented in a plugin.
Also, that wouldn't work for cases, where parts of HTML files are included into an index file and just the index file contains the doctype directive. I'm doing this often, that I include files via PHP include() function or SSI #include. plugins.geany.org is an example for that.
Absolutely. And since HTML5 is pretty much just "has a doctype of HTML", and really is just adding new elements and attributes / dropping defunct old ones, I'm thinking that XHTML and HTML4 with doctypes are the only things that can safely be detected, and only when the fragment of the page containing the doctype is being edited.
In this case I tend to say, let's just configure the (X)HTML version written by project settings under Project->Properties Menu. Maybe a plugin could add a new tab there? :)
I agree, a plugin that allows for selecting which HTML or XHTML spec, and strict or transitional, in the project properties. This is really not core Geany territory I reckon.
Not that I'm putting my hand up for it this week, however :) but if nobody else does anything about it, maybe I'll look at it sometime this year as pressure eases off.
On Sat, 23 Oct 2010 10:49:07 +1100 Lex Trotman elextr@gmail.com wrote:
Not sure about HTML5, but it might be nice to have a separate XHTML filetype. I don't know if making a custom filetype would work but it might be worth investigating if you like:
The problem I see is identifying the filetype, lots of (most?) xhtml tools generate files with the .html extension so you would have to read the file contents to identify it. IIUC custom filetypes only use the extension not the contents.
OK, then make XHTML a built-in filetype. Patches welcome.
Nick