Skip to content

punund/nu_plugin_ccl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nu_plugin_ccl

A Nushell plugin for parsing and generating CCL (Categorical Configuration Language).

Features

  • from ccl: Parse CCL input into Nushell structured data (Records and Lists).
    • Supports standard CCL syntax (key = value).
    • Smart List Parsing: heuristic support for vertical lists (indented blocks starting with =), converting them into proper Nushell Lists.
    • Recursive Embedding: recurses into string values to parse nested CCL structures embedded within strings (arbitrary depth).
  • to ccl: Serialize Nushell data into CCL format.
    • Generates standard key = value pairs.
    • Vertical Lists: serializes Lists using the vertical format ( = item).
    • Indented Nesting: serializes nested Records using indentation.
    • Smart string quoting.

Installation

cargo install --path .
plugin add target/debug/nu_plugin_ccl

Usage

Parsing CCL

"
server =
  port = 8080
  host = localhost
" | from ccl

Output:

╭────────┬──────────────────────╮
│        │ ╭──────┬───────────╮ │
│ server │ │ host │ localhost │ │
│        │ │ port │ 8080      │ │
│        │ ╰──────┴───────────╯ │
╰────────┴──────────────────────╯

Generating CCL

{
  details: {
    age: 30
    hobbies: [coding, gaming]
  }
} | to ccl

Output:

details =
  age = 30
  hobbies =
    = coding
    = gaming

Supported Formats

Vertical Lists

CCL uses vertical alignment for lists:

items =
   = item1
   = item2

This plugin correctly parses this into a List [item1, item2] and serializes Lists back into this format.

Nested Structures

Nested records are indented:

parent =
  child = value

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages