#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
use open qw(:std :utf8);
use Log::Any qw($log);
use Org::Parser;
use Org::Dump;
our $VERSION = '0.21'; # VERSION
my $input = [<>];
close STDIN; close ARGV; # so perl doesn't add ", <> line xx" upon dying
my $doc = Org::Parser->new->parse($input);
print Org::Dump::dump_element($doc);
1;
# ABSTRACT: Dump Org document structure
# PODNAME: dump-org-structure
__END__
=pod
=encoding UTF-8
=head1 NAME
dump-org-structure - Dump Org document structure
=head1 VERSION
version 0.21
=head1 SYNOPSIS
$ dump-org-structure foo.org
$ dump-org-structure < bar.org
Given an Org document like this:
* Andi Angkasa
- email :: andi@example.com
- birthday :: [1981-03-31 ]
will output something like:
Document:
Headline: l=1
(title)
Text: "Andi Angkasa"
(children)
List: D(-) indent=0
ListItem: -
(description term)
Text: "email"
(children)
Text: " andi@example.com\n"
ListItem: -
(description term)
Text: "birthday"
(children)
Text: " "
Timestamp: dt=1981-03-31T00:00:00 "[1981-03-31 Tue]"
Text: "\n"
=head1 DESCRIPTION
This script parse input using L<Org::Parser> and dump the structure in an
outline format. This script is mostly used for debugging.
=head1 SEE ALSO
L<Org::Parser>
=head1 HOMEPAGE
Please visit the project's homepage at L<https://metacpan.org/release/App-OrgUtils>.
=head1 SOURCE
Source repository is at L<https://github.com/sharyanto/perl-App-OrgUtils>.
=head1 BUGS
Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=App-OrgUtils>
When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.
=head1 AUTHOR
Steven Haryanto <stevenharyanto@gmail.com>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut