Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A base16 and base24 builder written in Rust, focused on convenience for template maintainers.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE-2.0
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

tinted-theming/tinted-builder-rust

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Matrix ChatCrates.ioTests

A builder forbase16 andbase24 templates using the0.11.1builderspecification.

This repo contains a command-line tool,tinted-builder-rust, to buildbase16 and base24 templates. It is also contains a library crate,tinted-builder, which you can use to directly build templates withinyour own Rust application.

Table of Contents

CLI

Installation

Cargo

cargo install tinted-builder-rust

Homebrew

brew tap tinted-theming/tintedbrew install tinted-builder-rust

Binaries

Download the relevant binary from therepository releases page.

Basic Usage

tinted-builder-rust sync# To sync with latest schemestinted-builder-rust build path/to/base16-template

Commands

The following is a table of the available subcommands for the CLI tool (tinted-builder-rust), including the descriptions and any notable arguments.

SubcommandDescriptionArgumentsExample UsageFlags
syncInstalls and or updates latest schemes.-tinted-builder-rust sync--quiet (silence stderr and stdout)
buildBuilds the themes of a template.template_path: Path to template directory.tinted-builder-rust build ./path/to/base16-template--quiet (silence stderr and stdout),--sync (equivalent of runningtinted-builder-rust sync beforetinted-builder-rust build)

Flags

Flag/OptionDescriptionApplicable SubcommandsDefault ValueExample Usage
--schemes-dir-sPath to a custom local schemes directory to use when building. Only necessary if thelatest schemes repository is not desired.buildtinted-builder-rust build . --schemes-dir=/path/to/schemes/dir
--data-dir-dSpecifies a custom path for the data directory.AllLinux:$XDG_DATA_HOME/tinted-theming/tinted-builder-rust or~/.local/share. MacOS:~/Library/Application\ Support/tinted-theming/tinted-builder-rusttinted-builder-rust sync --data-dir /path/to/custom/data-dir
--help-hDisplays help information for the subcommand.All-tinted-builder-rust --help,tinted-builder-rust build --help, etc
--version-VShows the version of tinted-builder-rust.All-tinted-builder-rust --version

Builder specification

tinted-builder-rust implements the0.11.1builder specification. Thisspecification details the scheme yaml format or schema as well as thevariables the builder should provide when rendering template mustachefile. Have a look at thebuilder specification document for moredetails.

Library

This library exposes aScheme andTemplate struct which you canuse to generate your own themes usingbase16 andbase24 templates and0.11.1 compliant base16 and base24 scheme files.

Internally tinted-builder-rust usesribboncurls to render the templates.

Library installation

cargo add tinted-builder-rust

Library Usage

use tinted_builder_rust::{Scheme,Template};use std::fs::read_to_string;let template_str =read_to_string("path/to/template.mustache").unwrap();let scheme_str =read_to_string("path/to/scheme.yml").unwrap();let scheme =Scheme::Base16(serde_yaml::from_str(&scheme_str).unwrap());let template =Template::new(template_str, scheme);template.render().unwrap();

The Scheme struct is as follows:

use std::collections::HashMap;use tinted_builder::{SchemeSystem,SchemeVariant};pubstructScheme{pubsystem:SchemeSystem,pubname:String,pubslug:String,pubauthor:String,pubdescription:Option<String>,pubvariant:SchemeVariant,pubpalette:HashMap<String,Color>,}pubstructColor{pubhex:(String,String,String),pubrgb:(u8,u8,u8),pubdec:(f32,f32,f32),}

Template::newTheTemplate struct simply sets the content provided to it viaTemplate::new.

template.render_to_file(&scheme) takes the scheme and generates thevariables defined in the0.11.1builder specification.

Contributing

Contributions are welcome! Have a look atCONTRIBUTING.md for moreinformation.

License

Ribboncurls is dual-licensed under the [Apache 2.0] and [MIT] licenses.For more information about the licenses of the projects used byRibboncurls, have a look atLICENSES-THIRD-PARTY.md.

About

A base16 and base24 builder written in Rust, focused on convenience for template maintainers.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE-2.0
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

 
 
 

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp