Skip to content

Commit

Permalink
Update documentation formatting
Browse files Browse the repository at this point in the history
Use newer doc plugins and format consistently
  • Loading branch information
facelessuser committed Aug 31, 2023
1 parent 1f05c31 commit 230be63
Show file tree
Hide file tree
Showing 11 changed files with 2,345 additions and 2,092 deletions.
363 changes: 185 additions & 178 deletions docs/src/markdown/about/changelog.md

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions docs/src/markdown/about/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ any tier you feel comfortable with. No amount is too little. We also accept one

## Bug Reports

1. Please **read the documentation** and **search the issue tracker** to try and find the answer to your question
**before** posting an issue.
1. Please **read the documentation** and **search the issue tracker** to try and find the answer to your question
**before** posting an issue.

2. When creating an issue on the repository, please provide as much information as possible:
2. When creating an issue on the repository, please provide as much information as possible:

- Version being used.
- Operating system.
- Version of Python.
- Errors in console.
- Detailed description of the problem.
- Examples for reproducing the error. You can post pictures, but if specific text or code is required to reproduce
the issue, please provide the text in a plain text format for easy copy/paste.
- Version being used.
- Operating system.
- Version of Python.
- Errors in console.
- Detailed description of the problem.
- Examples for reproducing the error. You can post pictures, but if specific text or code is required to
reproduce the issue, please provide the text in a plain text format for easy copy/paste.

The more info provided the greater the chance someone will take the time to answer, implement, or fix the issue.

3. Be prepared to answer questions and provide additional information if required. Issues in which the creator refuses
to respond to follow up questions will be marked as stale and closed.
3. Be prepared to answer questions and provide additional information if required. Issues in which the creator refuses
to respond to follow up questions will be marked as stale and closed.

## Reviewing Code

Expand Down
18 changes: 9 additions & 9 deletions docs/src/markdown/about/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ When writing code, the code should roughly conform to PEP8 and PEP257 suggestion
linter (with some additional plugins) to ensure code conforms (give or take some of the rules). When in doubt, follow
the formatting hints of existing code when adding files or modifying existing files. Listed below are the modules used:

- @gitlab:pycqa/flake8
- @gitlab:pycqa/flake8-docstrings
- @gitlab:pycqa/pep8-naming
- @ebeweber/flake8-mutable
- @gforcada/flake8-builtins
- @gitlab:pycqa/flake8
- @gitlab:pycqa/flake8-docstrings
- @gitlab:pycqa/pep8-naming
- @ebeweber/flake8-mutable
- @gforcada/flake8-builtins

Usually this can be automated with Tox (assuming it is installed): `tox -e lint`.

Expand All @@ -42,10 +42,10 @@ Usually this can be automated with Tox (assuming it is installed): `tox -e lint`
Documents are in Markdown (with with some additional syntax provided by extensions) and are converted to HTML via Python
Markdown. If you would like to build and preview the documentation, you must have these packages installed:

- @Python-Markdown/markdown: the Markdown parser.
- @mkdocs/mkdocs: the document site generator.
- @squidfunk/mkdocs-material: a material theme for MkDocs.
- @facelessuser/pymdown-extensions: this Python Markdown extension bundle.
- @Python-Markdown/markdown: the Markdown parser.
- @mkdocs/mkdocs: the document site generator.
- @squidfunk/mkdocs-material: a material theme for MkDocs.
- @facelessuser/pymdown-extensions: this Python Markdown extension bundle.

It is advised that you just install document dependencies with the following as the above list may not include all
document plugins:
Expand Down
34 changes: 18 additions & 16 deletions docs/src/markdown/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,26 @@ When detecting XHTML, Soup Sieve simply looks to see if the root element of an X
and does not currently look at the `doctype`. If in the future there is a need for stricter XHTML detection, this may
change.

- HTML document types (HTML, HTML5) will have their tag names and attribute names treated without case
sensitivity, like most browsers do.
- HTML document types (HTML, HTML5) will have their tag names and attribute names treated without case
sensitivity, like most browsers do.

- XML document types (including XHTML) will have their tag names and attribute names treated with case sensitivity.
- XML document types (including XHTML) will have their tag names and attribute names treated with case sensitivity.

- HTML5, XHTML and XML documents will have namespaces evaluated per the document's support (provided via the
parser). Some additional configuration is required when using namespaces, see [Namespace](#namespaces) for more
information.
- HTML5, XHTML and XML documents will have namespaces evaluated per the document's support (provided via the
parser). Some additional configuration is required when using namespaces, see [Namespace](#namespaces) for more
information.

!!! tip "Getting Proper Namespaces"
The `html5lib` parser provides proper namespaces for HTML5, but `lxml`'s HTML parser will not. If you need
namespace support for HTML5, consider using `html5lib`.
/// tip | Getting Proper Namespaces
The `html5lib` parser provides proper namespaces for HTML5, but `lxml`'s HTML parser will not. If you need
namespace support for HTML5, consider using `html5lib`.

For XML, the `lxml-xml` parser (`xml` for short) will provide proper namespaces. It is generally suggested that
`lxml-xml` is used to parse XHTML documents to take advantage of namespaces.
For XML, the `lxml-xml` parser (`xml` for short) will provide proper namespaces. It is generally suggested that
`lxml-xml` is used to parse XHTML documents to take advantage of namespaces.
///

- While attribute values are generally treated as case sensitive, HTML5 and HTML treat the `type` attribute
special. The `type` attribute's value is always case insensitive. This is generally how most browsers treat `type`. If
you need `type` to be sensitive, you can use the `s` flag: `#!css [type="submit" s]`.
- While attribute values are generally treated as case sensitive, HTML5 and HTML treat the `type` attribute
special. The `type` attribute's value is always case insensitive. This is generally how most browsers treat `type`.
If you need `type` to be sensitive, you can use the `s` flag: `#!css [type="submit" s]`.

While Soup Sieve access is exposed through Beautiful Soup's API, Soup Sieve's API can always be imported and accessed
directly for more controlled tag selection if needed.
Expand Down Expand Up @@ -180,8 +181,9 @@ would normally cause an identifier to be invalid.
'�'
```

!!! new "New in 1.9.0"
`escape` is a new API function added in 1.9.0.
/// new | New in 1.9.0
`escape` is a new API function added in 1.9.0.
///

## `soupsieve.compile()`

Expand Down
22 changes: 11 additions & 11 deletions docs/src/markdown/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ Soup Sieve has implemented most of the CSS selectors up through the latest CSS d
number that don't make sense in a non-browser environment. Selectors that cannot provide meaningful functionality simply
do not match anything. Some of the supported selectors are:

- `#!css .classes`
- `#!css #ids`
- `#!css [attributes=value]`
- `#!css parent child`
- `#!css parent > child`
- `#!css sibling ~ sibling`
- `#!css sibling + sibling`
- `#!css :not(element.class, element2.class)`
- `#!css :is(element.class, element2.class)`
- `#!css parent:has(> child)`
- and [many more](./selectors/index.md)
- `#!css .classes`
- `#!css #ids`
- `#!css [attributes=value]`
- `#!css parent child`
- `#!css parent > child`
- `#!css sibling ~ sibling`
- `#!css sibling + sibling`
- `#!css :not(element.class, element2.class)`
- `#!css :is(element.class, element2.class)`
- `#!css parent:has(> child)`
- and [many more](./selectors/index.md)

## Installation

Expand Down
Loading

0 comments on commit 230be63

Please sign in to comment.