Am Samstag, den 23.10.2010, 10:49 +1100 schrieb Lex Trotman: > On 23 October 2010 03:56, Nick Treleaven <[email protected]> > wrote: > > On Fri, 22 Oct 2010 23:46:08 +1100 > > Ross McKay <[email protected]> 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 <[email protected]> http://dominichopf.de/ Key Fingerprint: A7DF C4FC 07AE 4DDC 5CA0 BD93 AAB0 6019 CA7D 868D
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Geany mailing list [email protected] http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
