chordpro/lib.rs
1//! # Chordpro
2//! This crate is a chordpro parser. Chordpro is a simple text format for
3//! the notation of lyrics with chords. Although initially intended for
4//! guitarists, it can be used for all kinds of musical purposes.
5//! Specification of the format can be found in the official website:
6//! [https://www.chordpro.org/](https://www.chordpro.org/)
7//!
8//! To build a `Song` from a chordpro file:
9//! ```
10//! # use chordpro::Song;
11//! # use std::str::FromStr;
12//!
13//! let song = Song::from_str(r##"
14//! {title: Song Title}"
15//! {artist: The Artist}
16//!
17//! This is the first verse.
18//! You can specify chords using brackets.
19//! This is a [G]chord
20//!
21//! {soc}
22//! This is the chorus of the song
23//! [Em]You can also add some chords
24//! {eoc}
25//! "##).unwrap();
26//! ```
27
28#![crate_name = "chordpro"]
29
30extern crate pest;
31#[macro_use] extern crate pest_derive;
32extern crate serde;
33extern crate num_traits;
34#[macro_use] extern crate num_derive;
35
36pub mod chords;
37pub mod song;
38pub mod iterators;
39pub mod songparse;
40pub mod transpose;
41pub mod format;
42
43pub use {
44 chords::{
45 Chord,
46 Note
47 },
48 song::{
49 Song,
50 Section,
51 Paragraph,
52 Line,
53 Chunk
54 },
55 iterators::{
56 SectionIterator,
57 SectionMutIterator,
58 },
59 format::{
60 latin, Latin
61 }
62};