Namespaces

 
1.0.0-SNAPSHOT permalink Arrow_down_16x16
  • (but selector-step)
Selector predicate, matches elements which are rejected by the specified selector-step. See CSS :not

2 Examples top

  • ;;Original html
    ;<ul> 
    ; <li>Item 1</li>
    ; <li>Item 2</li>
    ; <li>Item 3</li>
    ; <li>Item 4</li>
    ; <li>Item 5</li>
    ;</ul>
    
    [:ul [:li (but first-of-type)]] (content "Some list item")
    
    ;After transformation using but transform all but the first element from a ;collection of of html list elements
    ;<ul> 
    ; <li>Item 1</li>
    ; <li>Some list item</li>
    ; <li>Some list item</li>
    ; <li>Some list item</li>
    ; <li>Some list item</li>
    ;</ul>
    
  • ;;Original html
    ;<ul> 
    ; <li>Item 1</li>
    ; <li>Item 2</li>
    ; <li>Item 3</li>
    ; <li>Item 4</li>
    ; <li>Item 5</li>
    ;</ul>
    
    [:ul [:li (but (nth-of-type 3))]] (content "Some content")
    
    ;; Transform all but the 3rd element from a collection of html list elements
    ;<ul> 
    ; <li>Some content</li>
    ; <li>Some content</li>
    ; <li>Item 3</li>
    ; <li>Some content</li>
    ; <li>Some content</li>
    ;</ul>
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source net/cgrand/enlive_html.clj:833 top

(defn but
 "Selector predicate, matches elements which are rejected by the specified selector-step. See CSS :not" 
 [selector-step]
  (intersection [any (but-node selector-step)]))
Vars in net.cgrand.enlive-html/but: defn
Used in 0 other vars

Comments top

No comments for but. Log in to add a comment.