From a89fb11c7c6a10f6ef7f1035967aec9d3718f3bd Mon Sep 17 00:00:00 2001 From: Pocco81 Date: Wed, 1 Sep 2021 14:06:43 -0500 Subject: [PATCH] chore: documented API --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 1e2bab3..2d2b66f 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ - [Updating](#updating) - [Usage](#usage) - [Commands](#commands) + - [API](#api) + - [Modules](#modules) - [Configuration](#-configuration) - [General](#general) - [List of Colorschemes](#list-of-colorschemes) @@ -79,6 +81,7 @@ Checkout the [CHANGELOG.md](https://github.com/Pocco81/Catppuccino.nvim/blob/main/CHANGELOG.md) file for more information on the notices below: @@ -327,6 +330,23 @@ The provides commands that follows the _camel casing_ naming convention and have - `:CPClear` clear all highlight groups. - `:colorscheme ` load a colorscheme, not necessarily a Catppuccino one. (Note: this is a built-in NVim command). +## API + +The API allows you fetch data from Catppuccino. It can be required as a Lua module: + +```lua +local cp_api = require("catppuccino.api.") +``` + +### Modules + ++ `colors` + +```lua +cp_api.get_colors() +``` +> Gets the colors from ``. Returns two values: the first one is a table with a `status` field (for the exit status) and a `msg` field with an error message in case `status` is `false` (error), and the second value is a table with the colors. If it fails, it will return the colors from `dark_catppuccino`. + # 🐬 Configuration Although settings already have self-explanatory names, here is where you can find info about each one of them and their classifications!