Skip to content

Commit

Permalink
Improve docs format (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangarha committed Jul 29, 2023
1 parent 402fbaa commit 916cfc5
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

Bidify helps to add bidirectional text support to HTML documents.

The project is in its very early stage of development and its interface or functionality may break from one version to another. Use it with caution.
The project is in its very early stage of development, and its interface or
functionality may break from one version to another. Use it with caution.

## Usage

Expand All @@ -16,16 +17,14 @@ bidified_html = Bidify.bidify_html_string(html_input)

## Rules

The `dir="auto"` attribute should be applied on "bidifiable" tags as per the following rules:
Bidification (the `dir="auto"` attribute) follows these simple rules:

- Only apply on "bidifiable" tags.
- All top-level elements
- All child elements except the first child
- It applies to "bidifiable" tags.
- It excludes the first immediate child element.
- It excludes `li` tags.

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.
The default bidifiable tags are `div`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`,
`p`, `ul`, `ol`, and `blockquote`. One can modify this list using options.

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:

Expand Down Expand Up @@ -57,15 +56,18 @@ puts bidifier.apply('<div>input stringified html</div>')

### Options

The following is the list of options with their default values
Available options with their default values are as follows:

- `greedy: false`

By default, bidification stops when it reaches an element that has `dir`
attribute. Use `true` to disregard any existing `dir` attributes.

- `with_table_support: false`

Use `true` to add table tags support.

## License

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

0 comments on commit 916cfc5

Please sign in to comment.