View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Mateu X. Hunter > Mojito-0.21 > Mojito



Annotate this POD


Open  0
View/Report Bugs
Module Version: 0.21   Source   Latest Release: Mojito-0.25


Mojito - A Web Document System


  use Mojito::Model::Config;
  my $mojito = Mojito->new(config => Mojito::Model::Config->new->config);
  my $page_id = '123456781234567812345678';
  my $rendered_page = $mojito->view_page({id => $page_id});

  # You might want to checkout one of the applications in app/
  # For example: 'plackup -Ilib app/' starts up a Web::Simple instance of Mojito


Mojito is a web document system that enables individuals to easily author HTML5 compliant documents. It provides a source editor for various markup languages along with a near realtime view pane. It allows for the intermixing of different source formats.

Attributes ^


Base of the application used for creating internal links.


Authenticated (Digest Auth) user name (aka REMOTE_USER)

Methods ^


Create a new page and return the url to redirect to, namely the page in edit mode. We might change this to view mode if demand persuades.


AJAX preview of a page (parse and render, save when button pressed)


Update a page given: content, id and base_url


Present the form with a page ready to be edited.


Given a page id, we retrieve its page from the db and return the HTML form of the page to the browser.


Given a page id, we retrieve its page from the db and return the HTML form of the page to the browser. This method is much like the view_page() method is setup for public pages (ones that do not require authentication).


Given a page id and a collection id we retrieve the collected page source from the db and return it as an HTML rendered page to the browser. This method is much like the view_page() method, but is setup for viewing pages in a collection with a collection navigation: next, previous, index (toc)


Create the view for the base of the application.


View the diff of a page.


Search the documents for a single word.


Collect documents. The id for each document submitted will be put into a list of document ids stored in the 'collection' collection. Yeah, that may seem strange at first, but the idea is we want to put allow for arbitrary sets of documents from the notes collection. We construct these sets by creating a list (array) of the corresponding document ids and inserting this "document" into the "collection" collection.

For example, the Beer collection document could look like:

        collection_name => 'Beer',
        documents       => [$some_doc_id, $another_doc_id, .. $last_doc_id]
        permissions     => { owner => 'rwx', group=> 'r', world => 'r' }

where the doc ids are the usual mongodb auto-generated id.

Return the /collections URL to which we'll redirect.


Store a sorted list of pages. Return the /collections URL to which we'll redirect.


Given a collection id, we concatentate all its page into one.


Given a collection id: * Delete it from the mongo DB Return the URL to of the collections index


Create and .epub document from the given collection.


Given a page id: * Delete it from the mongo DB * Remove it from the git repo Return the URL to recent (maybe home someday?)


Publish a page - Currently this means POST to a MM instance.


Get a feed in a particular format


A path for benchmarking to get an basic idea of performance.

Current Limitations ^

    * single word search
    * revision history doesn't have a web interface yet

Authors ^

Mateu Hunter

Copyright ^

Copyright 2011, Mateu Hunter

License ^

You may distribute this code under the same terms as Perl itself.

syntax highlighting: