From 9dd7ecde55b06b5114e1fa67c522433e7e59db8b Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Wed, 28 Sep 2022 11:30:26 +0530 Subject: Generate missing docs for utils.lua --- doc/colorizer.txt | 122 ++++++++++++++ doc/index.html | 4 +- doc/modules/colorizer.buffer.html | 2 +- doc/modules/colorizer.color.html | 2 +- doc/modules/colorizer.html | 2 +- doc/modules/colorizer.matcher.html | 2 +- doc/modules/colorizer.sass.html | 2 +- doc/modules/colorizer.tailwind.html | 2 +- doc/modules/colorizer.trie.html | 2 +- doc/modules/colorizer.utils.html | 326 ++++++++++++++++++++++++++++++++++++ lua/colorizer/utils.lua | 4 +- 11 files changed, 459 insertions(+), 11 deletions(-) create mode 100644 doc/modules/colorizer.utils.html diff --git a/doc/colorizer.txt b/doc/colorizer.txt index 8dcaa11..0aaf865 100644 --- a/doc/colorizer.txt +++ b/doc/colorizer.txt @@ -706,4 +706,126 @@ Trie implementation in luajit. todo: write documentation +============================================================================== +UTILS *colorizer.utils-introduction* + +Helper utils + + +============================================================================== +LUA API *colorizer.utils-lua-api* + +Functions: ~ + |byte_is_alphanumeric| - Obvious. + + |byte_is_hex| - Obvious. + + |byte_is_valid_colorchar| - Valid colorchars are alphanumeric and - ( + tailwind colors ) + + |get_last_modified| - Get last modified time of a file + + |merge| - Merge two tables. + + |parse_hex| - Obvious. + + |percent_or_hex| - Obvious. + + |watch_file| - Watch a file for changes and execute callback + + +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 + + + +byte_is_valid_colorchar({byte}) *colorizer.utils.byte_is_valid_colorchar* + Valid colorchars are alphanumeric and - ( tailwind colors ) + + Parameters: ~ + {byte} - number + + returns:~ + boolean + + + +get_last_modified({path}) *colorizer.utils.get_last_modified* + Get last modified time of a file + + Parameters: ~ + {path} - string: file path + + returns:~ + number or nil: modified time + + + +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 or nil + + + +watch_file({path}, {callback}, {...}) *colorizer.utils.watch_file* + Watch a file for changes and execute callback + + Parameters: ~ + {path} - string: File path + {callback} - function: Callback to execute + {...} - array: params for callback + + returns:~ + function or nil + + + vim:tw=80:ts=8:noet:ft=help:norl: diff --git a/doc/index.html b/doc/index.html index bbc15d1..0db74d8 100644 --- a/doc/index.html +++ b/doc/index.html @@ -38,7 +38,7 @@
  • sass
  • tailwind
  • trie
  • -
  • utils
  • +
  • utils
  • @@ -78,7 +78,7 @@ Trie implementation in luajit. - utils + colorizer.utils Helper utils diff --git a/doc/modules/colorizer.buffer.html b/doc/modules/colorizer.buffer.html index a120996..fc0888e 100644 --- a/doc/modules/colorizer.buffer.html +++ b/doc/modules/colorizer.buffer.html @@ -47,7 +47,7 @@
  • sass
  • tailwind
  • trie
  • -
  • utils
  • +
  • utils
  • diff --git a/doc/modules/colorizer.color.html b/doc/modules/colorizer.color.html index b36a8aa..74d4e55 100644 --- a/doc/modules/colorizer.color.html +++ b/doc/modules/colorizer.color.html @@ -45,7 +45,7 @@
  • sass
  • tailwind
  • trie
  • -
  • utils
  • +
  • utils
  • diff --git a/doc/modules/colorizer.html b/doc/modules/colorizer.html index fe2d381..9e56230 100644 --- a/doc/modules/colorizer.html +++ b/doc/modules/colorizer.html @@ -47,7 +47,7 @@
  • sass
  • tailwind
  • trie
  • -
  • utils
  • +
  • utils
  • diff --git a/doc/modules/colorizer.matcher.html b/doc/modules/colorizer.matcher.html index 9b2b67e..dd142eb 100644 --- a/doc/modules/colorizer.matcher.html +++ b/doc/modules/colorizer.matcher.html @@ -45,7 +45,7 @@
  • sass
  • tailwind
  • trie
  • -
  • utils
  • +
  • utils
  • diff --git a/doc/modules/colorizer.sass.html b/doc/modules/colorizer.sass.html index 56c8c63..dc4f6f4 100644 --- a/doc/modules/colorizer.sass.html +++ b/doc/modules/colorizer.sass.html @@ -45,7 +45,7 @@
  • sass
  • tailwind
  • trie
  • -
  • utils
  • +
  • utils
  • diff --git a/doc/modules/colorizer.tailwind.html b/doc/modules/colorizer.tailwind.html index 09e17ce..c6048ac 100644 --- a/doc/modules/colorizer.tailwind.html +++ b/doc/modules/colorizer.tailwind.html @@ -45,7 +45,7 @@
  • sass
  • tailwind
  • trie
  • -
  • utils
  • +
  • utils
  • diff --git a/doc/modules/colorizer.trie.html b/doc/modules/colorizer.trie.html index cc64359..f2bbd89 100644 --- a/doc/modules/colorizer.trie.html +++ b/doc/modules/colorizer.trie.html @@ -41,7 +41,7 @@
  • sass
  • tailwind
  • trie
  • -
  • utils
  • +
  • utils
  • diff --git a/doc/modules/colorizer.utils.html b/doc/modules/colorizer.utils.html new file mode 100644 index 0000000..a787177 --- /dev/null +++ b/doc/modules/colorizer.utils.html @@ -0,0 +1,326 @@ + + + + + colorizer Docs + + + + +
    + +
    + +
    +
    +
    + + +
    + + + + + + +
    + +

    Module colorizer.utils

    +

    Helper utils

    +

    + +

    + + +

    Functions

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    byte_is_alphanumeric (byte)Obvious.
    byte_is_hex (byte)Obvious.
    byte_is_valid_colorchar (byte)Valid colorchars are alphanumeric and - ( tailwind colors )
    get_last_modified (path)Get last modified time of a file
    merge (...)Merge two tables.
    parse_hex (byte)Obvious.
    percent_or_hex (v)Obvious.
    watch_file (path, callback, ...)Watch a file for changes and execute callback
    + +
    +
    + + +

    Functions

    + +
    +
    + + byte_is_alphanumeric (byte) +
    +
    + Obvious. + + +

    Parameters:

    +
      +
    • byte + number +
    • +
    + +

    Returns:

    +
      + + boolean +
    + + + + +
    +
    + + byte_is_hex (byte) +
    +
    + Obvious. + + +

    Parameters:

    +
      +
    • byte + number +
    • +
    + +

    Returns:

    +
      + + boolean +
    + + + + +
    +
    + + byte_is_valid_colorchar (byte) +
    +
    + Valid colorchars are alphanumeric and - ( tailwind colors ) + + +

    Parameters:

    +
      +
    • byte + number +
    • +
    + +

    Returns:

    +
      + + boolean +
    + + + + +
    +
    + + get_last_modified (path) +
    +
    + Get last modified time of a file + + +

    Parameters:

    +
      +
    • path + string: file path +
    • +
    + +

    Returns:

    +
      + + number|nil: modified time +
    + + + + +
    +
    + + merge (...) +
    +
    + Merge two tables.

    + +

    todo: Remove this and use vim.tbl_deep_extend + + +

    Parameters:

    +
      +
    • ... + + + +
    • +
    + +

    Returns:

    +
      + + table +
    + + + + +
    +
    + + parse_hex (byte) +
    +
    + Obvious. + + +

    Parameters:

    +
      +
    • byte + number +
    • +
    + +

    Returns:

    +
      + + number +
    + + + + +
    +
    + + percent_or_hex (v) +
    +
    + Obvious. + + +

    Parameters:

    +
      +
    • v + string +
    • +
    + +

    Returns:

    +
      + + number|nil +
    + + + + +
    +
    + + watch_file (path, callback, ...) +
    +
    + Watch a file for changes and execute callback + + +

    Parameters:

    +
      +
    • path + string: File path +
    • +
    • callback + function: Callback to execute +
    • +
    • ... + array: params for callback +
    • +
    + +

    Returns:

    +
      + + function|nil +
    + + + + +
    +
    + + +
    +
    +
    +generated by LDoc 1.4.6 +Last updated - September +
    +
    + + diff --git a/lua/colorizer/utils.lua b/lua/colorizer/utils.lua index 22fa6eb..282e405 100644 --- a/lua/colorizer/utils.lua +++ b/lua/colorizer/utils.lua @@ -1,5 +1,5 @@ ---Helper utils ---@module utils +--@module colorizer.utils local bit, ffi = require "bit", require "ffi" local band, bor, rshift, lshift = bit.band, bit.bor, bit.rshift, bit.lshift @@ -64,7 +64,7 @@ function utils.byte_is_hex(byte) return band(BYTE_CATEGORY[byte], CATEGORY_HEX) ~= 0 end ----Obvious. +---Valid colorchars are alphanumeric and - ( tailwind colors ) ---@param byte number ---@return boolean function utils.byte_is_valid_colorchar(byte) -- cgit v1.2.3-70-g09d2