package OpenGuides::JSON;
use strict;
use vars qw( $VERSION );
$VERSION = '0.03';
use Wiki::Toolkit::Plugin::JSON;
use Time::Piece;
use URI::Escape;
use Carp 'croak';
use JSON;
use OpenGuides::CGI;
rsion} = $args{og_version};
$self;
}
=over 4
=item B<emit_json>
Renders the given node as JSON
=cut
sub emit_json {
my ( $self, %args ) = @_;
my $node_name = $args{node};
f->json_maker->make_json($data);
}
=item B<output_as_json>
Renders the given arbitary data as JSON
=cut
sub output_as_json {
my ( $self, %args ) = @_;
return $self->json_maker->make_json(\
$conf{content_type} = "application/rdf+xml";
} elsif ( $args{format} eq "json" ) {
$template = "json_index.tt";
$conf{content_type} = "text/javascript";
} elsif
$guide->show_metadata(type => "category");
$guide->show_metadata(type => "category", format => "json");
Lists all metadata types, or all metadata values of a given
type. Useful for programatically
if($args{"format"}) {
if($args{"format"} eq "json") {
$content_type = "text/javascript";
my $json = OpenGuides::JSON->new( wiki => $wiki,