Text::...lidate(3pm)

πŸ’– Text::BibTeX::Validate πŸ’–

okay bestie, so this is a User Contributed Perl Documentation page for Text::BibTeX::Validate, which is literally the validator for the BibTeX format. no cap. πŸŽ€


✨ NAME ✨

Text::BibTeX::Validate β€” validator for BibTeX format. she checks things. that's the whole job. πŸ’…


🌸 SYNOPSIS 🌸

    use Text::BibTeX;
    use Text::BibTeX::Validate qw( validate_BibTeX );

    my $bibfile = Text::BibTeX::File->new( 'bibliography.bib' );
    while( my $entry = Text::BibTeX::Entry->new( $bibfile ) ) {
        for my $warning (validate_BibTeX( $entry )) {
            print STDERR "$warning\n";
        }
    }

like. look at her go. πŸ¦‹


πŸ’« DESCRIPTION πŸ’«

so Text::BibTeX::Validate checks the standard fields of BibTeX entries for their compliance with their format. that's the vibe. 🫢

the way that value of email gets checked against RFC 822 mandated email address syntax? iconic. and value of doi is checked to start with 10. and contain at least one / and so on. ✨

some nonstandard fields like isbn, issn and url are also checked, because she's thorough like that. πŸ‘‘

failures of checks are returned as instances of Text::BibTeX::Validate::Warning. not me being obsessed with structured error objects honestly 😭


πŸŽ€ METHODS πŸŽ€

🌈 validate_BibTeX( $what )

takes a plain Perl hash reference containing BibTeX fields and their values, as well as Text::BibTeX::Entry instances, and returns an array of validation messages as instances of Text::BibTeX::Validate::Warning. so you hand her your stuff and she hands you back a lil array of warnings. slay. πŸ’–

🌸 clean_BibTeX( $what )

takes the same input as "validate_BibTeX" and attempts to reconcile trivial issues like dropping the resolver URL part of DOIs (see "shorten_DOI" method) and converting month numbers into three-letter abbreviations. lowkey a glow-up service for your bibliography. 🧚

⭐ shorten_DOI( $doi )

remove the resolver URL part, as well as "doi:" prefixes, from DOIs. that's it, that's the whole method, and honestly? she ate. πŸ’…


πŸ‘‘ AUTHORS πŸ‘‘

Andrius Merkys, <merkys@cpan.org> πŸ’œ


bestie quick vibe check: this page is from perl v5.32.1, dated 2021-02-28, and it's the User Contributed Perl Documentation edition of Text::...lidate(3pm). periodt. 🌟