Skip to content

Commit

Permalink
Selector doc improvements (#153)
Browse files Browse the repository at this point in the history
* Improvements to selector documentation

- Move non-applicable pseudo classes to "Non-Applicable Psuedo Classes"
- Rework some paragraphs
- Add links to developer.mozilla.org selector references
- Start adding usage examples
- Removing spacing after badge icons

* Add more selector examples

* Update escape related info

* Add more examples

* More examples

* More selector docs improvements

* More examples and document enhancements

* Finish pseudo class examples

* Finish up adding examples for namespaces

* Fix some typos
  • Loading branch information
facelessuser authored Aug 18, 2019
1 parent b9fddc0 commit b613074
Show file tree
Hide file tree
Showing 5 changed files with 1,886 additions and 670 deletions.
1 change: 1 addition & 0 deletions docs/src/dictionary/en-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ accessor
amongst
boolean
builtin
centric
combinator
combinators
deprecations
Expand Down
1 change: 0 additions & 1 deletion docs/src/markdown/_snippets/selector_styles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ span.star::after {
position: relative;
display: inline-block;
font: normal normal normal 16px/1 FontAwesome;
padding-right: .50rem;
-moz-osx-font-smoothing: initial;
-webkit-font-smoothing: initial;
font-weight: 400;
Expand Down
11 changes: 9 additions & 2 deletions docs/src/markdown/differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@ about a malformed attribute, you may need to quote the value.
For instance, if you previously used a selector like this:

```py3
soup.select('[div={}]')
soup.select('[attr={}]')
```

You would need to quote the value as `{}` is not a valid CSS identifier, so it must be quoted:

```py3
soup.select('[div="{}"]')
soup.select('[attr="{}"]')
```

You can also use the [escape](./api.md#soupsieveescape) function to escape dynamic content:

```py3
import soupsieve
soup.select('[attr=%s]' % soupsieve.escape('{}'))
```

## CSS Identifiers
Expand Down
Loading

0 comments on commit b613074

Please sign in to comment.