Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangarha committed Jun 25, 2023
1 parent 2a43d0f commit 95afc56
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,32 @@ bidified_html = Bidify.bidify(html_input)
# bidified_html: '<p dir="auto">some content even in nested format</p>'
```

## Rules

The `dir="auto"` attribute should be applied on "bidifiable" tags as per the following rules:

- Only apply on "bidifiable" tags.
- All top-level elements
- All child elements except the first child

Bidifiable elements can be defined as per the use case requirements (not yet implemented).
The default bidifiable tags are: `div`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `p`, `ul`, `ol`, `blockquote`.

Notice that `li` elements shouldn't get `dir=auto` otherwise, the list appearance gets damaged.

As a complementary step, CSS styles should use [logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_logical_properties_and_values). Here are a few examples:

```css
/* Physical properties */
text-align: left;
padding-right: 10px;
border-left: 1px;
/* Logical properties */
text-align: start;
padding-inline-end: 10px;
border-inline-start: 1px;
```

## License

This project is a Free/Libre and Open Source software released under LGPLv3 license.

0 comments on commit 95afc56

Please sign in to comment.