Black098 / zen-coding

Automatically exported from code.google.com/p/zen-coding
0 stars 0 forks source link

Unique numbering with access to parent index #159

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
table>tr*4>td#idc$*4>img[onclick]

Generates:

<table>
        <tr>
                <td id="idc1"><img src="" alt="" onclick="" /></td>
                <td id="idc2"><img src="" alt="" onclick="" /></td>
                <td id="idc3"><img src="" alt="" onclick="" /></td>
                <td id="idc4"><img src="" alt="" onclick="" /></td>
        </tr>
        <tr>
                <td id="idc1"><img src="" alt="" onclick="" /></td>
                <td id="idc2"><img src="" alt="" onclick="" /></td>
                <td id="idc3"><img src="" alt="" onclick="" /></td>
                <td id="idc4"><img src="" alt="" onclick="" /></td>
        </tr>
        <tr>
                <td id="idc1"><img src="" alt="" onclick="" /></td>
                <td id="idc2"><img src="" alt="" onclick="" /></td>
                <td id="idc3"><img src="" alt="" onclick="" /></td>
                <td id="idc4"><img src="" alt="" onclick="" /></td>
        </tr>
        <tr>
                <td id="idc1"><img src="" alt="" onclick="" /></td>
                <td id="idc2"><img src="" alt="" onclick="" /></td>
                <td id="idc3"><img src="" alt="" onclick="" /></td>
                <td id="idc4"><img src="" alt="" onclick="" /></td>
        </tr>
</table>

It would be useful to have a method to generate the html bellow?

<table>
        <tr>
                <td id="idc1_1"><img src="" alt="" onclick="" /></td>
                <td id="idc2_1"><img src="" alt="" onclick="" /></td>
                <td id="idc3_1"><img src="" alt="" onclick="" /></td>
                <td id="idc4_1"><img src="" alt="" onclick="" /></td>
        </tr>
        <tr>
                <td id="idc1_2"><img src="" alt="" onclick="" /></td>
                <td id="idc2_2"><img src="" alt="" onclick="" /></td>
                <td id="idc3_2"><img src="" alt="" onclick="" /></td>
                <td id="idc4_2"><img src="" alt="" onclick="" /></td>
        </tr>
        <tr>
                <td id="idc1_3"><img src="" alt="" onclick="" /></td>
                <td id="idc2_3"><img src="" alt="" onclick="" /></td>
                <td id="idc3_3"><img src="" alt="" onclick="" /></td>
                <td id="idc4_3"><img src="" alt="" onclick="" /></td>
        </tr>
        <tr>
                <td id="idc1_4"><img src="" alt="" onclick="" /></td>
                <td id="idc2_4"><img src="" alt="" onclick="" /></td>
                <td id="idc3_4"><img src="" alt="" onclick="" /></td>
                <td id="idc4_4"><img src="" alt="" onclick="" /></td>
        </tr>
</table>

maybe some way to refer to parent index

Original issue reported on code.google.com by ppaul...@gmail.com on 4 May 2010 at 2:06

GoogleCodeExporter commented 9 years ago
ul>li*5>(a[href=images/large/image-$$.jpg]>img[src=images/thumb/image-$$.jpg]

will display:

<ul>
    <li><a href="images/large/image-01.jpg"><img src="images/thumb/image-01.jpg" alt="" /></a></li>
    <li><a href="images/large/image-01.jpg"><img src="images/thumb/image-01.jpg" alt="" /></a></li>
    <li><a href="images/large/image-01.jpg"><img src="images/thumb/image-01.jpg" alt="" /></a></li>
    <li><a href="images/large/image-01.jpg"><img src="images/thumb/image-01.jpg" alt="" /></a></li>
    <li><a href="images/large/image-01.jpg"><img src="images/thumb/image-01.jpg" alt="" /></a></li>
</ul>

It should be nice to have a way to refer from parent element for zencoding 
numbering feature. Any idea about this?

Original comment by bac...@glomund.net on 13 Apr 2011 at 8:27

GoogleCodeExporter commented 9 years ago
a.lepee, it was fixed in v0.7

Original comment by serge....@gmail.com on 13 Apr 2011 at 9:21

GoogleCodeExporter commented 9 years ago
Oups, never mind,  I upgrade right now :)
Thanks for your quick answer

Original comment by bac...@glomund.net on 13 Apr 2011 at 10:27

GoogleCodeExporter commented 9 years ago

Original comment by serge....@gmail.com on 4 Jul 2012 at 8:57

GoogleCodeExporter commented 9 years ago
Accidentally closed this issue, re-opening. I need to think about your first 
example.

Original comment by serge....@gmail.com on 4 Jul 2012 at 8:59

GoogleCodeExporter commented 9 years ago
A numbering like the following would be useful too:

<table>
        <tr>
                <td id="idc1"><img src="" alt="" onclick="" /></td>
                <td id="idc2"><img src="" alt="" onclick="" /></td>
                <td id="idc3"><img src="" alt="" onclick="" /></td>
                <td id="idc4"><img src="" alt="" onclick="" /></td>
        </tr>
        <tr>
                <td id="idc5"><img src="" alt="" onclick="" /></td>
                <td id="idc6"><img src="" alt="" onclick="" /></td>
                <td id="idc7"><img src="" alt="" onclick="" /></td>
                <td id="idc8"><img src="" alt="" onclick="" /></td>
        </tr>
        <tr>
                <td id="idc9"><img src="" alt="" onclick="" /></td>
                <td id="idc10"><img src="" alt="" onclick="" /></td>
                <td id="idc11"><img src="" alt="" onclick="" /></td>
                <td id="idc12"><img src="" alt="" onclick="" /></td>
        </tr>
        <tr>
                <td id="idc13"><img src="" alt="" onclick="" /></td>
                <td id="idc14"><img src="" alt="" onclick="" /></td>
                <td id="idc15"><img src="" alt="" onclick="" /></td>
                <td id="idc16"><img src="" alt="" onclick="" /></td>
        </tr>
</table>

Original comment by sammmm...@googlemail.com on 14 Mar 2014 at 8:09