diff options
author | Akianonymus <anonymus.aki@gmail.com> | 2022-09-09 23:55:43 +0530 |
---|---|---|
committer | Aki <anonymus.aki@gmail.com> | 2022-09-14 11:47:08 +0530 |
commit | f986d9a0ea1feff1388b5c7d297ec3faa19036a7 (patch) | |
tree | 501de10a0709883b9facfb26960f59a181b58d01 /doc | |
parent | buffer_utils: Do not error when lsp info cannot be fetched (diff) |
[FEATURE] Add support for sass variables
Import support
import using use and import keyword
multiple imports in single line
multiple imports in multiple lines ( using commas )
recursive imports
watch imports for changes and automatically rehighlight buffer
buffer variables
recursive variables support
multiple variables in single line
parse imported files only when they are changed
Loosely based on https://github.com/norcalli/nvim-colorizer.lua/pull/22/files
Diffstat (limited to 'doc')
-rw-r--r-- | doc/colorizer.txt | 64 | ||||
-rw-r--r-- | doc/modules/colorizer.buffer_utils.html | 4 | ||||
-rw-r--r-- | doc/modules/colorizer.color_utils.html | 110 | ||||
-rw-r--r-- | doc/modules/colorizer.html | 7 | ||||
-rw-r--r-- | doc/modules/colorizer.utils.html | 87 | ||||
-rw-r--r-- | doc/modules/trie.html | 80 | ||||
-rw-r--r-- | doc/modules/utils.html | 64 | ||||
-rw-r--r-- | doc/tags | 4 |
8 files changed, 247 insertions, 173 deletions
diff --git a/doc/colorizer.txt b/doc/colorizer.txt index 3661d8f..87a3a90 100644 --- a/doc/colorizer.txt +++ b/doc/colorizer.txt @@ -208,7 +208,9 @@ user_default_options *colorizer.user_default_options* mode = "background", -- Set the display mode. -- Available methods are false / true / "normal" / "lsp" / "both" -- True is same as normal - tailwind = false -- Enable tailwind colors + tailwind = false, -- Enable tailwind colors + -- parsers can contain values used in |user_default_options| + sass = { enable = false, parsers = { css }, }, -- Enable sass colors virtualtext = "■", } < @@ -226,6 +228,7 @@ user_default_options *colorizer.user_default_options* {css_fn} - boolean {mode} - string {tailwind} - boolean|string + {sass} - table {virtualtext} - string @@ -292,7 +295,7 @@ highlight_buffer({buf}, {ns}, {lines}, {line_start}, {line_end}, {options}, {options_local} - table: Buffer local variables returns:~ - nil or boolean or number,function or nil + nil or boolean or number,table @@ -309,7 +312,7 @@ rehighlight_buffer({buf}, {options}, {options_local}, {use_local_lines}) options_local returns:~ - nil or boolean or number,function or nil + nil or boolean or number,table @@ -348,6 +351,14 @@ Functions: ~ |color_name_parser| - Grab all the colour values from `vim.api.nvim_get_color_map` and create a lookup table. + |sass_cleanup| - Cleanup sass variables + + |sass_update_variables| - Parse the given lines for sass variabled and add + to SASS[buf].DEFINITIONS_ALL. + + |sass_name_parser| - Parse the given line for sass color names + check for value in SASS[buf].DEFINITIONS_ALL + |rgb_function_parser| - Parse for rgb() css function and return rgb hex. |rgba_function_parser| - Parse for rgba() css function and return rgb hex. @@ -390,6 +401,53 @@ color_name_parser({line}, {i}, {opts}) *colorizer.color_utils.color_name_parser* +sass_cleanup({buf}) *colorizer.color_utils.sass_cleanup* + Cleanup sass variables + + Parameters: ~ + {buf} - number + + + + + *colorizer.color_utils.sass_update_variables* +sass_update_variables({buf}, {line_start}, {line_end}, {lines}, {color_parser}, +{options}, {options_local}) + Parse the given lines for sass variabled and add to + SASS[buf].DEFINITIONS_ALL. + + which is then used in |sass_name_parser| + If lines are not given, then fetch the lines with line_start and line_end + + + Parameters: ~ + {buf} - number + {line_start} - number + {line_end} - number + {lines} - table|nil + {color_parser} - function|boolean + {options} - table: Buffer options + {options_local} - table|nil: Buffer local variables + + returns:~ + boolean + + + +sass_name_parser({line}, {i}, {buf}) *colorizer.color_utils.sass_name_parser* + Parse the given line for sass color names + check for value in SASS[buf].DEFINITIONS_ALL + + Parameters: ~ + {line} - string: Line to parse + {i} - number: Index of line from where to start parsing + {buf} - number + + returns:~ + number or nil, string or nil + + + rgb_function_parser({line}, {i}) *colorizer.color_utils.rgb_function_parser* Parse for rgb() css function and return rgb hex. diff --git a/doc/modules/colorizer.buffer_utils.html b/doc/modules/colorizer.buffer_utils.html index 7260c5c..8d7beaa 100644 --- a/doc/modules/colorizer.buffer_utils.html +++ b/doc/modules/colorizer.buffer_utils.html @@ -148,7 +148,7 @@ <h3>Returns:</h3> <ol> - nil|boolean|number,function|nil + nil|boolean|number,table </ol> @@ -182,7 +182,7 @@ <h3>Returns:</h3> <ol> - nil|boolean|number,function|nil + nil|boolean|number,table </ol> diff --git a/doc/modules/colorizer.color_utils.html b/doc/modules/colorizer.color_utils.html index a02853b..6e26961 100644 --- a/doc/modules/colorizer.color_utils.html +++ b/doc/modules/colorizer.color_utils.html @@ -68,6 +68,19 @@ <td class="summary">Grab all the colour values from <code>vim.api.nvim_get_color_map</code> and create a lookup table.</td> </tr> <tr> + <td class="name" nowrap><a href="#sass_cleanup">sass_cleanup (buf)</a></td> + <td class="summary">Cleanup sass variables</td> + </tr> + <tr> + <td class="name" nowrap><a href="#sass_update_variables">sass_update_variables (buf, line_start, line_end, lines, color_parser, options, options_local)</a></td> + <td class="summary">Parse the given lines for sass variabled and add to SASS[buf].DEFINITIONS_ALL.</td> + </tr> + <tr> + <td class="name" nowrap><a href="#sass_name_parser">sass_name_parser (line, i, buf)</a></td> + <td class="summary">Parse the given line for sass color names + check for value in SASS[buf].DEFINITIONS_ALL</td> + </tr> + <tr> <td class="name" nowrap><a href="#rgb_function_parser">rgb_function_parser (line, i)</a></td> <td class="summary">Parse for rgb() css function and return rgb hex.</td> </tr> @@ -157,6 +170,103 @@ </dd> <dt> + <a name = "sass_cleanup"></a> + <strong>sass_cleanup (buf)</strong> + </dt> + <dd> + Cleanup sass variables + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">buf</span> + number + </li> + </ul> + + + + + +</dd> + <dt> + <a name = "sass_update_variables"></a> + <strong>sass_update_variables (buf, line_start, line_end, lines, color_parser, options, options_local)</strong> + </dt> + <dd> + Parse the given lines for sass variabled and add to SASS[buf].DEFINITIONS<em>ALL. + which is then used in |sass</em>name<em>parser| + If lines are not given, then fetch the lines with line</em>start and line_end + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">buf</span> + number + </li> + <li><span class="parameter">line_start</span> + number + </li> + <li><span class="parameter">line_end</span> + number + </li> + <li><span class="parameter">lines</span> + table|nil + </li> + <li><span class="parameter">color_parser</span> + function|boolean + </li> + <li><span class="parameter">options</span> + table: Buffer options + </li> + <li><span class="parameter">options_local</span> + table|nil: Buffer local variables + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + boolean + </ol> + + + + +</dd> + <dt> + <a name = "sass_name_parser"></a> + <strong>sass_name_parser (line, i, buf)</strong> + </dt> + <dd> + Parse the given line for sass color names + check for value in SASS[buf].DEFINITIONS_ALL + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">line</span> + string: Line to parse + </li> + <li><span class="parameter">i</span> + number: Index of line from where to start parsing + </li> + <li><span class="parameter">buf</span> + number + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + number|nil, string|nil + </ol> + + + + +</dd> + <dt> <a name = "rgb_function_parser"></a> <strong>rgb_function_parser (line, i)</strong> </dt> diff --git a/doc/modules/colorizer.html b/doc/modules/colorizer.html index 311bd60..edc06db 100644 --- a/doc/modules/colorizer.html +++ b/doc/modules/colorizer.html @@ -400,7 +400,9 @@ Setup an autocmd which enables colorizing for the filetypes and options specifie mode = "background", -- Set the display mode. -- Available methods are false / true / "normal" / "lsp" / "both" -- True is same as normal - tailwind = false -- Enable tailwind colors + tailwind = false, -- Enable tailwind colors + -- parsers can contain values used in |user_default_options| + sass = { enable = false, parsers = { css }, }, -- Enable sass colors virtualtext = "■", } </pre> @@ -443,6 +445,9 @@ Setup an autocmd which enables colorizing for the filetypes and options specifie <li><span class="parameter">tailwind</span> boolean|string </li> + <li><span class="parameter">sass</span> + table + </li> <li><span class="parameter">virtualtext</span> string </li> diff --git a/doc/modules/colorizer.utils.html b/doc/modules/colorizer.utils.html deleted file mode 100644 index 9bca259..0000000 --- a/doc/modules/colorizer.utils.html +++ /dev/null @@ -1,87 +0,0 @@ -============================================================================== -UTILS *colorizer.utils* - -Helper utils - - -============================================================================== -LUA API *colorizer.utils* - -Available Functions: - - |colorizer.utils.byte_is_alphanumeric| - Obvious - - |colorizer.utils.byte_is_hex| - Obvious - - |colorizer.utils.merge| - Merge two tables - TODO Remove this and use vim.tbl_deep_extend - - |colorizer.utils.parse_hex| - Obvious - - |colorizer.utils.percent_or_hex| - Obvious - - - -byte_is_alphanumeric({byte}) |colorizer.utils.byte_is_alphanumeric| - Obvious - - - Parameters: - {byte} - number - - Returns: - boolean - - - -byte_is_hex({byte}) |colorizer.utils.byte_is_hex| - Obvious - - - Parameters: - {byte} - number - - Returns: - boolean - - - -merge({...}) |colorizer.utils.merge| - Merge two tables - TODO Remove this and use vim.tbl_deep_extend - - - Parameters: - {...} - - - Returns: - table - - - -parse_hex({byte}) |colorizer.utils.parse_hex| - Obvious - - - Parameters: - {byte} - number - - Returns: - number - - - -percent_or_hex({v}) |colorizer.utils.percent_or_hex| - Obvious - - - Parameters: - {v} - string - - Returns: - number|nil - - - - - vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/doc/modules/trie.html b/doc/modules/trie.html deleted file mode 100644 index e353630..0000000 --- a/doc/modules/trie.html +++ /dev/null @@ -1,80 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> -<head> - <title>colorizer Docs</title> - <link rel="stylesheet" href="../ldoc.css" type="text/css" /> -</head> -<body> - -<div id="container"> - -<div id="product"> - <div id="product_logo"></div> - <div id="product_name"><big><b></b></big></div> - <div id="product_description"></div> -</div> <!-- id="product" --> - - -<div id="main"> - - -<!-- Menu --> - -<div id="navigation"> -<br/> -<h1>colorizer</h1> - -<ul> - <li><a href="../index.html">Index</a></li> -</ul> - - - -<h2>Modules</h2> -<ul class="nowrap"> - <li><a href="../modules/colorizer.html">colorizer</a></li> - <li><a href="../modules/colorizer.buffer_utils.html">buffer_utils</a></li> - <li><a href="../modules/colorizer.color_utils.html">color_utils</a></li> - <li><a href="../modules/colorizer.matcher_utils.html">matcher_utils</a></li> - <li><strong>trie</strong></li> - <li><a href="../modules/utils.html">utils</a></li> -</ul> - -</div> - -<div id="content"> - -<h1>Module <code>trie</code></h1> -<p>Trie implementation in luajit.</p> -<p> Copyright © 2019 Ashkan Kiani - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version.</p> - -<p> This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p> - - - -<br/> -<br/> - - - - -</div> <!-- id="content" --> -</div> <!-- id="main" --> -<div id="about"> -<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i> -<i style="float:right;">Last updated 2022-09-02 21:37:16 </i> -</div> <!-- id="about" --> -</div> <!-- id="container" --> -</body> -</html> diff --git a/doc/modules/utils.html b/doc/modules/utils.html index 8ff8fed..3e6fb0a 100644 --- a/doc/modules/utils.html +++ b/doc/modules/utils.html @@ -79,6 +79,14 @@ <td class="name" nowrap><a href="#percent_or_hex">percent_or_hex (v)</a></td> <td class="summary">Obvious.</td> </tr> + <tr> + <td class="name" nowrap><a href="#get_last_modified">get_last_modified (path)</a></td> + <td class="summary">Get last modified time of a file</td> + </tr> + <tr> + <td class="name" nowrap><a href="#watch_file">watch_file (path, callback, ...)</a></td> + <td class="summary">Watch a file for changes and execute callback</td> + </tr> </table> <br/> @@ -217,6 +225,62 @@ </dd> + <dt> + <a name = "get_last_modified"></a> + <strong>get_last_modified (path)</strong> + </dt> + <dd> + Get last modified time of a file + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">path</span> + string: file path + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + number|nil: modified time + </ol> + + + + +</dd> + <dt> + <a name = "watch_file"></a> + <strong>watch_file (path, callback, ...)</strong> + </dt> + <dd> + Watch a file for changes and execute callback + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">path</span> + string: File path + </li> + <li><span class="parameter">callback</span> + function: Callback to execute + </li> + <li><span class="parameter">...</span> + array: params for callback + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + function|nil + </ol> + + + + +</dd> </dl> @@ -12,6 +12,7 @@ colorizer.buffer_utils-introduction colorizer.txt /*colorizer.buffer_utils-intro colorizer.buffer_utils-lua-api colorizer.txt /*colorizer.buffer_utils-lua-api* colorizer.buffer_utils.DEFAULT_NAMESPACE colorizer.txt /*colorizer.buffer_utils.DEFAULT_NAMESPACE* colorizer.buffer_utils.HIGHLIGHT_MODE_NAMES colorizer.txt /*colorizer.buffer_utils.HIGHLIGHT_MODE_NAMES* +colorizer.buffer_utils.clear_hl_cache colorizer.txt /*colorizer.buffer_utils.clear_hl_cache* colorizer.buffer_utils.highlight_buffer colorizer.txt /*colorizer.buffer_utils.highlight_buffer* colorizer.buffer_utils.rehighlight_buffer colorizer.txt /*colorizer.buffer_utils.rehighlight_buffer* colorizer.clear_highlight_cache colorizer.txt /*colorizer.clear_highlight_cache* @@ -25,6 +26,9 @@ colorizer.color_utils.hsla_function_parser colorizer.txt /*colorizer.color_utils colorizer.color_utils.rgb_function_parser colorizer.txt /*colorizer.color_utils.rgb_function_parser* colorizer.color_utils.rgba_function_parser colorizer.txt /*colorizer.color_utils.rgba_function_parser* colorizer.color_utils.rgba_hex_parser colorizer.txt /*colorizer.color_utils.rgba_hex_parser* +colorizer.color_utils.sass_cleanup colorizer.txt /*colorizer.color_utils.sass_cleanup* +colorizer.color_utils.sass_name_parser colorizer.txt /*colorizer.color_utils.sass_name_parser* +colorizer.color_utils.sass_update_variables colorizer.txt /*colorizer.color_utils.sass_update_variables* colorizer.detach_from_buffer colorizer.txt /*colorizer.detach_from_buffer* colorizer.get_buffer_options colorizer.txt /*colorizer.get_buffer_options* colorizer.highlight_buffer colorizer.txt /*colorizer.highlight_buffer* |