Skip to content

Commit

Permalink
fix(docs): make lists panvimdoc friendly (#13)
Browse files Browse the repository at this point in the history
* fix(docs): make lists panvimdoc friendly

* chore(ci): auto generate docs

---------

Co-authored-by: ramojus <[email protected]>
  • Loading branch information
ramojus and ramojus authored Jan 21, 2024
1 parent a5c7b7e commit da71920
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 29 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Non-original color sets are made to match their original version as closely as p
These color sets don't get loaded, unless you specify them in a `color_set` option, so there is no performance impact.

Available color sets:

- `mellifluous`. Dark and light, original.
- `alduin`. Dark, [link to original](https://github.com/alessandroyorba/alduin).
- `mountain`. Dark, [link to original](https://github.com/mountain-theme/mountain).
Expand Down Expand Up @@ -214,6 +215,7 @@ highlighter.set(name, definition_map)
```

Parameters:

- `name`: highlight group name in string format
- `definition_map`: highlight definition map in table format, the supported keys can be found in `:h nvim_set_hl`. Keys `fg`, `bg` and `sp` can also be set to any of the available colors (see [available colors](#available-colors)).

Expand All @@ -229,6 +231,7 @@ This function returns highlight definition map for highlight group with the requ
To use one of the available colors from a color set, in highlight definition map, set the value of `fg`, `bg` or `sp` key to `colors.available_color`

Available colors:

- Syntax element colors.
- `main_keywords`: used to indicate keywords related to control flow.
- `other_keywords`
Expand Down Expand Up @@ -257,6 +260,7 @@ NOTE: some color sets may have more colors available. See [extra colors](#extra-

#### Color functions
Every color from [available colors](#available-colors) has the following meta functions (accessed with `:` operator):

- `lightened(val)`: returns color with `val` added current to lightness.
- `darkened(val)`: returns color with `val` subtracted from current lightness.
- `with_lightness(val)`: returns color with specified lightness, where `val` can be from 0 to 100.
Expand All @@ -270,6 +274,7 @@ To create your own color that has the same functions available, use `require('me
Type `:Mellifluous <TAB>` and see the available options.

Options include:

- Toggling transparency.
- Changing color set.

Expand Down
76 changes: 47 additions & 29 deletions doc/mellifluous.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,12 @@ possible with the same highlight rules as mellifluous.
These color sets don’t get loaded, unless you specify them in a `color_set`
option, so there is no performance impact.

Available color sets: - `mellifluous`. Dark and light, original. - `alduin`.
Dark, link to original <https://github.com/alessandroyorba/alduin>. -
`mountain`. Dark, link to original
<https://github.com/mountain-theme/mountain>. - `tender`. Dark, link to
original <https://github.com/jacoborus/tender.vim>.
Available color sets:

- `mellifluous`. Dark and light, original.
- `alduin`. Dark, link to original <https://github.com/alessandroyorba/alduin>.
- `mountain`. Dark, link to original <https://github.com/mountain-theme/mountain>.
- `tender`. Dark, link to original <https://github.com/jacoborus/tender.vim>.


MELLIFLUOUS COLOR SET CONFIGURATION ~
Expand Down Expand Up @@ -252,10 +253,10 @@ This is the signature to set a highlight:
highlighter.set(name, definition_map)
<

Parameters: - `name`: highlight group name in string format - `definition_map`:
highlight definition map in table format, the supported keys can be found in
|nvim_set_hl|. Keys `fg`, `bg` and `sp` can also be set to any of the available
colors (see |mellifluous-available-colors|).
Parameters:

- `name`: highlight group name in string format
- `definition_map`: highlight definition map in table format, the supported keys can be found in |nvim_set_hl|. Keys `fg`, `bg` and `sp` can also be set to any of the available colors (see |mellifluous-available-colors|).

To get an existing highlight, use this function:

Expand All @@ -272,17 +273,31 @@ AVAILABLE COLORS ~
To use one of the available colors from a color set, in highlight definition
map, set the value of `fg`, `bg` or `sp` key to `colors.available_color`

Available colors: - Syntax element colors. - `main_keywords`: used to indicate
keywords related to control flow. - `other_keywords` - `types` - `operators` -
`strings` - `functions` - `constants` - `comments` - `fg`: in code –
identifiers. - `bg` - Named colors. Used for terminal colors, but most of these
colors will match some syntax element color. - `red` - `orange` - `green` -
`blue` - `purple` - UI colors. Same as named colors, but all are of the same
brightness (lightness). - `ui_red`: used to indicate errors, deletes, bad
spellings. - `ui_orange`: used to indicate warnings, changes, other (strange)
spellings. - `ui_green`: used to indicate staged, additions. - `ui_blue`: used
to indicate information, new files. - `ui_purple`: used to indicate hints,
merge.
Available colors:

- Syntax element colors.
- `main_keywords`: used to indicate keywords related to control flow.
- `other_keywords`
- `types`
- `operators`
- `strings`
- `functions`
- `constants`
- `comments`
- `fg`: in code – identifiers.
- `bg`
- Named colors. Used for terminal colors, but most of these colors will match some syntax element color.
- `red`
- `orange`
- `green`
- `blue`
- `purple`
- UI colors. Same as named colors, but all are of the same brightness (lightness).
- `ui_red`: used to indicate errors, deletes, bad spellings.
- `ui_orange`: used to indicate warnings, changes, other (strange) spellings.
- `ui_green`: used to indicate staged, additions.
- `ui_blue`: used to indicate information, new files.
- `ui_purple`: used to indicate hints, merge.

NOTE: some color sets may have more colors available. See
|mellifluous-extra-colors| section.
Expand All @@ -291,14 +306,14 @@ NOTE: some color sets may have more colors available. See
COLOR FUNCTIONS ~

Every color from |mellifluous-available-colors| has the following meta
functions (accessed with `:` operator): - `lightened(val)`: returns color with
`val` added current to lightness. - `darkened(val)`: returns color with `val`
subtracted from current lightness. - `with_lightness(val)`: returns color with
specified lightness, where `val` can be from 0 to 100. - `saturated(val)`:
returns color with `val` added to current saturation. - `desaturated(val)`:
returns color with `val` subtracted from current saturation. -
`with_saturation(val)`: returns color with specified saturation, where `val`
can be from 0 to 100.
functions (accessed with `:` operator):

- `lightened(val)`: returns color with `val` added current to lightness.
- `darkened(val)`: returns color with `val` subtracted from current lightness.
- `with_lightness(val)`: returns color with specified lightness, where `val` can be from 0 to 100.
- `saturated(val)`: returns color with `val` added to current saturation.
- `desaturated(val)`: returns color with `val` subtracted from current saturation.
- `with_saturation(val)`: returns color with specified saturation, where `val` can be from 0 to 100.

To create your own color that has the same functions available, use
`require('mellifluous.color').new(hex_value)` function.
Expand All @@ -309,7 +324,10 @@ To create your own color that has the same functions available, use

Type `:Mellifluous <TAB>` and see the available options.

Options include: - Toggling transparency. - Changing color set.
Options include:

- Toggling transparency.
- Changing color set.


==============================================================================
Expand Down

0 comments on commit da71920

Please sign in to comment.