Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The Cargo.toml file uses the TOML format. See the example in Program 1. It is divided in multiple sections denoted by square brackets ([]):

Table 1:The fields of the package section

Field

Description

name

The package name.

version

The package version.

edition

The Rust edition used to compile the package.

license

The package license. Note the AND keyword that allows to combine two licenses. In the example we use the two French licenses CeCILL-B and CeCILL-C from CEA, CNRS and INRIA. See CeCILL. See SPDX license List.

description

A package description.

documentation

URL to the package’s documentation.

homepage

URL to the package’s homepage, if different from documentation and repository URLs.

repository

The URL to the package’s repository.

authors

The authors (array format).

readme

The README file.

exclude

An array of files to exclude from the package. Those files will not be published.

categories

An array of up to 5 categories in which to classify this package. See All Valid Category Slugs.

keywords

An array of up to 5 keywords, used when searching for a crate on the registry. Any word is accepted.

[package]
name = "ansiconv"
version = "1.2.3"
edition = "2024"
license = "CECILL-B AND CECILL-C"
description = "A library and tools to parse ANSI escape codes from text."
repository = "https://gitlab.com/cnrgh/infotools/ansiconv"
authors = ["Pierrick Roger <pierrick.roger@cea.fr>"]
readme = "README.md"
exclude = ["Makefile"]
categories = ["command-line-utilities"]
keywords = ["shell", "library", "ANSI", "escape", "text"]

[dependencies]
build_html = "2.8.0"
clap = { version = "4.6.1", features = ["derive"] }
env_logger = "0.11.10"
glob = "0.3.3"
log = "0.4.32"

[lib]
path = "src/lib.rs"
test = true

[[bin]]
name = "ansi2tex"
path = "src/cli_ansi2tex.rs"

[[bin]]
name = "ansi2html"
path = "src/cli_ansi2html.rs"

Program 1:Example of a Cargo.toml file