summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-04-21reformat BK3 page as CommonMarkJonas Smedegaard
  • #!/usr/bin/perl
  • # tidy BibLaTeX file
  • # Depends: bibclean libpath-tiny-perl
  • use v5.36;
  • use strict;
  • use IPC::Run3 qw/run3/;
  • =head1 NAME
  • biblatex-tidy - tidy BibLaTeX data
  • =head1 VERSION
  • Version 0.0.1
  • =head1 SYNOPSIS
  • biblatex-tidy INFILE
  • biblatex-tidy INFILE OUTFILE
  • biblatex-tidy < INFILE > OUTFILE
  • =head1 DESCRIPTION
  • B<biblatex-tidy> reformats BibLaTeX data.
  • If a only a single filename is given,
  • the file contents are replaced.
  • If two filenames are given,
  • the first is read and cleaned output is saved the the second.
  • If no filenames are given,
  • then data is expected on STDIN
  • and cleaned data is emitted on STDOUT.
  • Internally,
  • the tool B<bibclean> is called internally to do the actual tidying.
  • If data contains a line beginning with C<@Comment{jabref-meta:>,
  • typically added by JabRef at the end of BibLaTeX data,
  • then the remaining data is I<not> cleaned,
  • because B<bibclean> fails to parse such comments.
  • =cut
  • # slurp INFILE if passed as first argument, or else STDIN
  • my ( $infile, $outfile, $bogus ) = @ARGV;
  • die 'Too many arguments: expected INFILE and OUTFILE' if $bogus;
  • @ARGV = ($infile) if $infile;
  • my $content = do { local $/ = undef; <> };
  • # put aside eventual trailing JabRef comments to not confuse bibclean
  • my ( $data, $comments ) = split /(?=\n\@Comment\{jabref-meta:)/, $content, 2;
  • # call bibclean on comment-stripped data
  • my @command = qw(bibclean -max-width 0);
  • my $newdata;
  • run3( \@command, \$data, \$newdata,
  • <2024-04-18
    add dot fileIan Valentin Christensen
    2024-04-18drop obsolete teamsJonas Smedegaard
    2024-04-18place page break before evaluation headlineJonas Smedegaard
    2024-04-17reorganize graph/ -> backstage/Jonas Smedegaard
    2024-04-16fix gantt hintsJonas Smedegaard
    2024-04-16generated by cgit v1.2.3 (git 2.46.0) at 2025-09-12 02:50:54 +0000 ver-highlight'>
    2024-04-16fix gantt hintsJonas Smedegaard
    2024-04-16fix reference @Schraube_2024Jonas Smedegaard
    2024-04-16fix macro pagebreakJonas Smedegaard
    2024-04-16update contentJonas Smedegaard
    2024-04-16add make targets pad-export-worlding*Jonas Smedegaard
    2024-04-16streamline make targets pad-export-*Jonas Smedegaard
    2024-04-16add references @Mikkelsen_2000 @Hansted_2014Jonas Smedegaard
    2024-04-16fix typoJonas Smedegaard
    2024-04-15add relational mapJonas Smedegaard
    2024-04-15split trash project from worldingJonas Smedegaard
    2024-04-11use only ASCII characters as citekeyJonas Smedegaard
    2024-04-11distinguish PAD_ARTICLES from ARTICLESJonas Smedegaard
    2024-04-11hide noisy lint ruleJonas Smedegaard
    2024-04-11note on challenging Søren Riis' idea that curiosity always works against ↵Jonas Smedegaard
    identity
    2024-04-11use semantic newlinesJonas Smedegaard
    2024-04-11add draft bk4 reportJonas Smedegaard
    2024-04-10add prefix S to PDF output filename, as expected by rdf-related make targetsJonas Smedegaard
    2024-04-10extend investigationsJonas Smedegaard
    2024-04-10extend reference @Andersen_2015 to add chapter @Heilesen_2015Jonas Smedegaard
    2024-04-10add to investigationsJonas Smedegaard
    2024-04-09reference book instead of describing itJonas Smedegaard
    2024-04-09reference Schraubes bookJonas Smedegaard
    2024-04-09fix minor errorsIan Valentin Christensen
    2024-04-09add draft of introJonas Smedegaard
    2024-04-08add Ernst Schraubes book as referenceJonas Smedegaard
    2024-04-08adjust conclusionJonas Smedegaard
    2024-04-08fix grammatical errorsIan Valentin Christensen
    2024-04-08add initial minimal conclusionJonas Smedegaard
    2024-04-07remove trailing spacesIan Valentin Christensen
    2024-04-07add intro to undersøgelserIan Valentin Christensen
    2024-04-07comment out notes from previous teamsJonas Smedegaard
    2024-04-07omit index.qmd from markdown-lintJonas Smedegaard