Dave Foy wrote:
I'm having trouble creating a custom snippet
that, for me, would be
I want to set up a snippet to create an unordered list nav from a
plain text list, e.g.
I'd like to highlight the whole list, hit a key combo, which would
wrap each list item in <li>, wrap the whole lot in <ul>, and even wrap
the text within each list item in <a href=""></a> for good measure.
Here's the command I came up with:
return '\t<li><a href="">%s</a></li>' %
print "\n".join(["<ul>"] +
[wrap(line) for line in sys.stdin] + ["</ul>"])
Actually, the following is probably clearer and easier to change,
without any knowledge of python:
for line in sys.stdin:
print '\t<li><a href="">' + line.strip() +