[svn:parrot] r47684 - in branches/html_cleanup: . tools/docs
coke at svn.parrot.org
coke at svn.parrot.org
Fri Jun 18 03:58:08 UTC 2010
Author: coke
Date: Fri Jun 18 03:58:07 2010
New Revision: 47684
URL: https://trac.parrot.org/parrot/changeset/47684
Log:
Add first cut at 'make html' replacement.
- parse JSON files.
- expand all source/exclude directives.
- handle intra-page sections.
Added:
branches/html_cleanup/tools/docs/make_html_docs.pl
- copied, changed from r47680, branches/html_cleanup/tools/docs/write_docs.pl
Modified:
branches/html_cleanup/MANIFEST
Modified: branches/html_cleanup/MANIFEST
==============================================================================
--- branches/html_cleanup/MANIFEST Fri Jun 18 03:56:00 2010 (r47683)
+++ branches/html_cleanup/MANIFEST Fri Jun 18 03:58:07 2010 (r47684)
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Fri Jun 18 00:35:06 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Jun 18 02:28:44 2010 UT
#
# See below for documentation on the format of this file.
#
@@ -2155,6 +2155,7 @@
tools/dev/vms-patch []
tools/dev/vtablize.pl []
tools/docs/filename_and_chapter.pl []
+tools/docs/make_html_docs.pl []
tools/docs/mk_chm.pl []
tools/docs/ops_summary.pl []
tools/docs/write_docs.pl []
Copied and modified: branches/html_cleanup/tools/docs/make_html_docs.pl (from r47680, branches/html_cleanup/tools/docs/write_docs.pl)
==============================================================================
--- branches/html_cleanup/tools/docs/write_docs.pl Fri Jun 18 01:01:15 2010 (r47680, copy source)
+++ branches/html_cleanup/tools/docs/make_html_docs.pl Fri Jun 18 03:58:07 2010 (r47684)
@@ -4,11 +4,11 @@
=head1 NAME
-tools/docs/write_docs.pl - Write HTML documentation
+tools/docs/make_html_docs.pl - Write HTML documentation
=head1 SYNOPSIS
- % perl tools/docs/write_docs.pl [--silent]
+ % perl tools/docs/make_html_docs.pl [--silent] [--version]
=head1 DESCRIPTION
@@ -19,8 +19,10 @@
use strict;
use warnings;
use lib 'lib';
+
+use Fatal qw/open close/;
use Getopt::Long;
-use Parrot::Docs::Section::Parrot;
+use JSON;
my ( $silent, $version );
@@ -28,9 +30,47 @@
'version=s' => \$version,
);
-my $docs = Parrot::Docs::Section::Parrot->new;
+my $json = JSON->new();
-$docs->write_docs( $silent, $version );
+foreach my $index_file (glob 'docs/index/*.json') {
+ my $contents;
+ open my $fh, '<', $index_file;
+ { local $/; $contents = <$fh>}
+ my $section = $json->decode($contents);
+
+ my $outfile = $section->{page} . '.html';
+ my $title = $section->{title};
+ print " URL : $outfile\n";
+ print " Title : $title\n";
+
+ foreach my $chunk (@{$section->{content}}) {
+ print " Section Title : " . $chunk->{title} . "\n";
+
+ my @raw_sources;
+ if (ref $chunk->{source} eq "ARRAY" ) {
+ @raw_sources = @{$chunk->{source}};
+ } else {
+ push @raw_sources, $chunk->{source};
+ };
+
+ my %sources;
+ foreach my $source_elem (@raw_sources) {
+ foreach my $file (glob($source_elem)) {
+ $sources{$file} = 1;
+ }
+ }
+
+ # These are only literals, no globs (for now?)
+ if (exists $chunk->{exclude}) {
+ foreach my $exclusion (@{$chunk->{exclude}}) {
+ delete $sources{$exclusion}
+ }
+ }
+ print join('; ', sort keys %sources);
+ print "\n";
+ }
+ print "\n";
+}
exit 0;
More information about the parrot-commits
mailing list