App-Music-ChordPro

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


    !Highlights

    - Configuration files are now [Really Relaxed JSON](https://metacpan.org/pod/JSON::Relaxed#REALLY-RELAXED-EXTENSIONS) files.
      These are much easier to write and maintain than JSON.
      Don't worry, everything is still backward compatible with the
      older JSON and slightly relaxed JSON formats. And ChordPro can
      [convert your config files](https://www.chordpro.org/chordpro/using-chordpro/#convert-config) for you.

    - Nick Berendsen kindly offered to create a native GUI for macOS.
      It looks great and behaves nicely in the way macOS applications should
      behave. And it doesn't have the restrictions on opening and saving
      of files that the 'classic' GUI suffers from.
      Thanks Nick!

    - ChordPro bundles free replacement fonts to be used instead of
      the corefonts. No configs or settings needed.

    !Functionality
    - (PDF, page sort) Use sorttitle for page sorting.
    - Images: Ignore align with x percentage. Issue warning.

lib/ChordPro/Config/Properties.pm  view on Meta::CPAN

Property values can be anything. The value will be I<expanded> before
being assigned to the property unless it is placed between single
quotes C<''>.

Expansion means:

=over

=item *

A tilde C<~> in what looks like a file name will be replaced by the
value of C<${HOME}>.

=item *

If the value contains C<${I<name>}>, I<name> is first looked up in the
current environment. If an environment variable I<name> can be found,
its value is substituted.

If no suitable environment variable exists, I<name> is looked up as a
property and, if it exists and has a non-empty value, this value is

lib/ChordPro/Output/Markdown.pm  view on Meta::CPAN

	return ( md_textline($cp.$t_line) );
    }

    my $c_line = "";
    foreach ( 0..$#{$elt->{chords}} ) {
		$c_line .= chord( $elt->{chords}->[$_] ) . " ";
		$t_line .= $phrases[$_];
		my $d = length($c_line) - length($t_line);
		$t_line .= "-" x $d if $d > 0;
		$c_line .= " " x -$d if $d < 0;
    } # this looks like setting the chords above the words.

    s/\s+$// for ( $t_line, $c_line );

	# main problem in markdown - a fixed position is only available in "Code escapes" so weather to set
	# a tab or a double backticks (``)  - i tend to the tab - so all lines with tabs are "together"
	if ($c_line ne ""){ # Block-lines are not replacing initial spaces - as the are "code"
		$t_line = $cp.$t_line."  ";
		$c_line = $cp.$c_line."  ";
		}
	else{

lib/ChordPro/Utils.pm  view on Meta::CPAN

	s/([[:^print:]])/sprintf("\\u%04x", ord($1))/ge;
	return $_ unless /[\\\s]/ || $force;
	return qq("$_");
    }
}

push( @EXPORT, 'qquote' );

# Safely print values.

use Scalar::Util qw(looks_like_number);

# We want overload:
# sub pv( $val )
# sub pv( $label, $val )

sub pv {
    my $val   = pop;
    my $label = pop // "";

    my $suppressundef;
    if ( $label =~ /\?$/ ) {
	$suppressundef++;
	$label = $';
    }
    if ( defined $val ) {
	if ( looks_like_number($val) ) {
	    $val = sprintf("%.3f", $val);
	    $val =~ s/0+$//;
	    $val =~ s/\.$//;
	}
	else {
	    $val = qquote( $val, 1 );
	}
    }
    else {
	return "" if $suppressundef;

lib/ChordPro/lib/JSON/Relaxed.pm  view on Meta::CPAN

is equivalent to

    foo: {
        bar: blech
    }

Requires C<combined_keys> or C<prp> option. Overruled by C<strict>.

=head2 Implied outer hash

If the JSON looks like a hash, i.e. a string (key) followed by a
C<:>, the outer C<{> and C<}> are implied.

For example:

    foo : bar

is equivalent to:

    { foo : bar }

lib/ChordPro/res/config/chordpro.json  view on Meta::CPAN

// Includes are processed first, before the rest of
// the config file.
// 
// "include" takes a list of either filenames or preset names.
include : [ guitar ]

// General settings, often changed by configs and command line.
settings {

  // Chords parsing strategy.
  // Strict (only known chords) or relaxed (anything that looks sane)
  strict : true

  // Obsolete.
  lineinfo : true

  // Titles flush: default center.
  titles : center

  // Number of columns, default: 1.
  columns : 1

lib/ChordPro/res/config/config.schema  view on Meta::CPAN

          "default" : false
        },

        "notenames" : {
          "description" : "Allow parsing of note names in [].",
          "type" : "boolean",
          "default" : false
        },

        "strict" : {
          "description" : "Chords parsing strategy.\nStrict (only known chords) or relaxed (anything that looks sane)",
          "type" : "boolean",
          "default" : true
        },

        "suppress-empty-chords" : {
          "description" : "Suppress empty chord lines.\nCommand line: -a (--single-space).",
          "type" : "boolean",
          "default" : true
        },

lib/ChordPro/res/pod/Config.pod  view on Meta::CPAN

    // Includes are processed first, before the rest of
    // the config file.
    // 
    // "include" takes a list of either filenames or preset names.
    include : [ guitar ]
    
    // General settings, often changed by configs and command line.
    settings {
    
      // Chords parsing strategy.
      // Strict (only known chords) or relaxed (anything that looks sane)
      strict : true
    
      // Obsolete.
      lineinfo : true
    
      // Titles flush: default center.
      titles : center
    
      // Number of columns, default: 1.
      columns : 1

t/380_roundtrip.t  view on Meta::CPAN

  # May be a string containing pretext %s posttext.
  # Defaults to "[%s]" if true.
  inline-chords = false
  # Chords under the lyrics.
  chords-under = false
  # Transcoding.
  transcode = null
  # Always decapoize.
  decapo = false
  # Chords parsing strategy.
  # Strict (only known) or relaxed (anything that looks sane).
  chordnames = "strict"
  # Allow note names in [].
  notenames = false
}

# Metadata.
# For these keys you can use {meta key ...} as well as {key ...}.
# If strict is nonzero, only the keys named here are allowed.
# If strict is zero, {meta ...} will accept any key.
# Important: "title" and "subtitle" must always be in this list.



( run in 0.457 second using v1.01-cache-2.11-cpan-64827b87656 )