Skip to content

Drop XHTML support and add html5 #845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sedrubal opened this issue Jan 5, 2017 · 5 comments
Closed

Drop XHTML support and add html5 #845

sedrubal opened this issue Jan 5, 2017 · 5 comments

Comments

@sedrubal
Copy link
Contributor

sedrubal commented Jan 5, 2017

I think it's not worth to support XHTML anymore. Instead there should be proper html5 templates.

See UltiSnips/html.snippets

related: #804

@lpil
Copy link
Contributor

lpil commented Jan 6, 2017

Sounds good to me! :)

@jorgesumle
Copy link
Contributor

jorgesumle commented Jan 30, 2017

In snippets/html.snippets, instead of calling html5 and html5l, we could simply call html and htmll to trigger the base HTML snippets. This would also mean removing the current html (it only does <html>{$0}</html>) snippet, which I think is quite useless in my opinion.

In the same file, we could also remove old DOCTYPES snippets (XHTML, HTML4...) and only leave the one for HTML 5 DOCTYPE.

What do you think? I would like to hear opinions before making a pull request trying to impose my changes. If you like this idea, I can make a pull request. I don't if @honza, as HTML Django maintainer, also maintains this or if he should review this first.

@lpil
Copy link
Contributor

lpil commented Jan 31, 2017

I don't there is value in renaming snippets without good reason, it will confuse people who are used to typing html5. It's only one more character and it's rarely typed.

Much more interested in the smaller more frequently typed ones.

@jorgesumle
Copy link
Contributor

jorgesumle commented May 18, 2017

Below is the html.snippet I use for HTML. It just supports HTML 5.1. I don't know if it is good to have a snippet for every single HTML tag. Some people probably want just the basic ones. Anyway, tell me what do you think so that me or someone else can make a pull request.

priority -50

snippet a
<a href="$1">$2</a>
endsnippet

snippet abbr
<abbr title="$2">$1</abbr>
endsnippet

snippet access
accesskey="$1"
endsnippet

snippet address
<address>$1</address>
endsnippet

snippet article
<article>
	${1:article content}
</article>
endsnippet

snippet aside
<aside>
	${1:aside content}
</aside>
endsnippet

snippet b
<b>$1</b>
endsnippet

snippet blockquote
<blockquote>$1</blockquote>
endsnippet

snippet br
<br>$1</br>
endsnippet

snippet button
<button>$1</button>
endsnippet

snippet caption
<caption>$1</caption>
endsnippet

snippet cite
<cite>$1</cite>
endsnippet

snippet class
class="$1"
endsnippet

snippet code
<code>$1</code>
endsnippet

snippet data
<data value="$2">$1</data>
endsnippet

snippet datalist
<datalist id="$1" name="$2">
	opt$3
</datalist>
endsnippet

snippet dd
<dd>$1</dd>
endsnippet

snippet del
<del cite="$2" datetime="${3:`date '+%Y-%m-%dT%H:%M:%S%:z'`}">$1</del>
endsnippet

snippet dfn
<dfn>$1</dfn>
endsnippet

snippet div
<div>$1</div>
endsnippet

snippet dl
<dl>
	${1:Definition list}
</dl>
endsnippet

snippet dt
<dt>$1</dt>
endsnippet

snippet em
<em>$1</em>
endsnippet

snippet fieldset
<fieldset>
	${1:fields}
</fieldset>
endsnippet

snippet fig
<figure>
$1
<figcaption>$2</figcaption>
</figure>
endsnippet

snippet figcaption
<figcaption>$1</figcaption>
endsnippet

snippet footer
<footer>
	${1:footer content}
</footer>
endsnippet

snippet form
<form>
	${1:form controls}
</form>
endsnippet

snippet h1
<h1>$1</h1>
endsnippet

snippet h2
<h2>$1</h2>
endsnippet

snippet h3
<h3>$1</h3>
endsnippet

snippet h4
<h4>$1</h4>
endsnippet

snippet h5
<h5>$1</h5>
endsnippet

snippet h6
<h6>$1</h6>
endsnippet

snippet header
<header>
	${1:header content}
</header>
endsnippet

snippet hr
<hr>
endsnippet

snippet html "HTML basic structure" b
	<!DOCTYPE html>
	<html>
		<head>
			<meta charset="UTF-8" />
			<meta name="viewport" content="width=device-width" />
			<title>${1:`!p snip.rv = snip.basename.replace('-', ' ').capitalize()`}</title>
		</head>
		<body>
			${0:body}
		</body>
	</html>
endsnippet

snippet htmll "HTML basic structure with the lang attribute" b
	<!DOCTYPE html>
	<html lang="${1:es}">
		<head>
			<meta charset="UTF-8" />
			<meta name="viewport" content="width=device-width" />
			<title>${2:`!p snip.rv = snip.basename.replace('-', ' ').capitalize()`}</title>
		</head>
		<body>
			${0:body}
		</body>
	</html>
endsnippet

snippet i
<i>$1</i>
endsnippet

snippet id
id="$1"
endsnippet

snippet img
<img src="$1" alt="$2">
endsnippet

snippet input
<input name="$1">
endsnippet

snippet input:color
<input name="$1" type="color">
endsnippet

snippet input:checkbox
<input name="$1" type="checkbox">
endsnippet

snippet input:date
<input name="$1" type="date">
endsnippet

snippet input:email
<input name="$1" type="email">
endsnippet

snippet input:file
<input name="$1" type="file">
endsnippet

snippet input:hidden
<input name="$1" type="hidden" value="$2">
endsnippet

snippet input:number
<input name="$1" type="number">
endsnippet

snippet input:password
<input name="$1" type="password">
endsnippet

snippet input:radio
<input name="$1" type="radio">
endsnippet

snippet input:reset
<input type="reset">
endsnippet

snippet input:search
<input name="$1" type="search">
endsnippet

snippet input:tel
<input name="$1" type="tel">
endsnippet

snippet input:url
<input name="$1" type="url">
endsnippet

snippet ins
<ins cite="$2" datetime="${3:`date '+%Y-%m-%dT%H:%M:%S%:z'`}">$1</ins>
endsnippet

snippet kbd
<kbd>$1</kbd>
endsnippet

snippet label
<label>$1</label>
endsnippet

snippet legend
<legend>$1</leyend>
endsnippet

snippet li
<li>$1</li>
endsnippet

snippet link "CSS link"
<link rel="stylesheet" href="$1" type="text/css">
endsnippet

snippet main
<main>
	${1:main content}
</main>
endsnippet

snippet mark
<mark>$1</mark>
endsnippet

snippet meta
<meta name="$1" content"$2">
endsnippet

snippet meter
<meter>$1</meter>
endsnippet

snippet nav
<nav>
	${1:navigation links}
</nav>
endsnippet

snippet noscript
<noscript>$1</noscript>
endsnippet

snippet ol
<ol>
	<li>$1</li>
</ol>
endsnippet

snippet opt
<option value="$2">$1</option>
endsnippet

snippet optgroup
<optgroup label="$1">
	opt$2
</optgroup>
endsnippet

snippet output
<output for="$1" name="$2">$3</output>
endsnippet

snippet p
<p>$1</p>
endsnippet

snippet picture
<picture>
	${1:image sources}
</picture>
endsnippet

snippet pre
<pre>$1</pre>
endsnippet

snippet progress
<progress>$1</progress>
endsnippet

snippet q
<q>$1</q>
endsnippet

snippet s
<s>$1</s>
endsnippet

snippet samp
<samp>$1</samp>
endsnippet

snippet script
<script>
$1
</script>
endsnippet

snippet scriptsrc
<script src="$1"></script>
endsnippet

snippet section
<section>
	${1:section content}
</section>
endsnippet

snippet select
<select name="$1">
	opt$2
</select>
endsnippet

snippet small
<small>$1</small>
endsnippet

snippet span
<span>$1</span>
endsnippet

snippet strong
<strong>$1</strong>
endsnippet

snippet style
<style>
	${1:CSS code}
</style>
endsnippet

snippet sub
<sub>$1</sub>
endsnippet

snippet sup
<sup>$1</sup>
endsnippet

snippet table
<table>
	${1:Table content}
</table>
endsnippet

snippet tbody
<tbody>$1</tbody>
endsnippet

snippet td
<td>$1</td>
endsnippet

snippet template
<template id="$1">
$2
</template>
endsnippet

snippet textarea
<textarea name="$2">$1</textarea>
endsnippet

snippet tfoot
<tfoot>$1</tfoot>
endsnippet

snippet th
<th>$1</th>
endsnippet

snippet thead
<thead>$1</thead>
endsnippet

snippet time
<time datetime="$2">$1</time>
endsnippet

snippet tr
<tr>
	td$1
</tr>
endsnippet

snippet ul
<ul>
	<li>$1</li>
</ul>
endsnippet

snippet var
<var>$1</var>
endsnippet

snippet wbr
<wbr>$1</wbr>
endsnippet

# vim:ft=snippets:

@lpil
Copy link
Contributor

lpil commented May 18, 2017

Seems like it would be a good addition :)

This was referenced May 19, 2017
@lpil lpil closed this as completed May 28, 2017
sedrubal added a commit to sedrubal/vim-snippets that referenced this issue Oct 21, 2018
This breaks compatibility with XHTML (see honza#845).
The slashes are even forbidden in HTML4 (but optional in HTML5).
Source: <http://xahlee.info/js/html5_non-closing_tag.html>
lpil pushed a commit that referenced this issue Oct 21, 2018
This breaks compatibility with XHTML (see #845).
The slashes are even forbidden in HTML4 (but optional in HTML5).
Source: <http://xahlee.info/js/html5_non-closing_tag.html>
tbehner pushed a commit to tbehner/vim-snippets that referenced this issue Jun 4, 2019
This breaks compatibility with XHTML (see honza#845).
The slashes are even forbidden in HTML4 (but optional in HTML5).
Source: <http://xahlee.info/js/html5_non-closing_tag.html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants