Coder Social home page Coder Social logo

paradocs's Introduction

Paradocs logo

Paradocs (prounounced /ˈpærədɒks/ it means next to the docs and also it's a paradox, get it?!?) is a Javascript documentation engine based entirely in the Github API. It's basically a Backbone.js wrapper, that let's you easily fetch compiled Markdown from Github API.

Installation

Installing paradocs via bower in your project

bower install paradocs

or just download it and put it your project

Then add it to your HTML source:

<script src="path/to/paradocs.js"></script>

Starting the engine

$(document).ready(function() {
  Paradocs.start({repo: 'bugsense/docs'});
});

Initialization Options

  • el - DOM element that the docs will be rendered to

  • repo - Github repo (eg. joyent/node) from where the docs will be fetched

  • root - Root URL from where the router will be started, for more info here

Example

Paradocs.start({
  repo: 'bugsense/docs',
  root: 'docs',
  el: 'div#docs'
});

Customizing to your needs

  • Paradocs.fail [ function ]

    This callback will be executed when the AJAX calls fails for some reason

    Example

    Paradocs.fail = function () {
      $('body').html(Paradocs.errorTmpl);
    };
  • Paradocs.Router [ function ]

    Overriding the default Backbone Router

    Example

    Paradocs.View = Backbone.View.extend({
      initialize: function () {
        this.el = options.get('el')
        data.on('change', this.render, this);
        return this;
      },
      customFunctionThatDoesSth: function() {
        /* do your awesome stuff here */
      },
      render: function () {
        $(this.el).html(Paradocs.get('text')).addClass(Paradocs.get('tech'));
        $('ul', '.'+Paradocs.get('tech')).html(Paradocs.get('nav'));
        this.customFunctionThatDoesSth();
      }
    });
  • Paradocs.View [ function ]

    Overriding the default Backbone View

    Example

    Paradocs.View = Backbone.View.extend({
      initialize: function () {
        this.el = options.get('el')
        data.on('change', this.render, this);
        // Custom stuff you want to do
        return this;
      },
      customWeirdFunction: function() {
        // more custom stuff
      },
      render: function () {
        $(this.el).html(Paradocs.get('text')).addClass(Paradocs.get('tech'));
        $('ul', '.'+Paradocs.get('tech')).html(Paradocs.get('nav'));
        this.customWeirdStuff();
      }
    });

How it works

Paradocs is written entirelly in JavaScript and be modular and as decoupled as possible from any backend code, so it can be used for any projects with little maintenance, without writing too many lines of code. Also you can use it in any backend framework without having to do operations, deploys etc.

It uses Github repositories and blobs as a storage and Github API to retrieve the Markdown files. Github API return generated HTML. The API call changes according to the route you're currently visiting. Eg. if you're reading /docs/v1/android, the Paradocs will fetch the android.md from the Github repository.

Features

  • It's fast
  • It's easy/effortless
  • It has (almost) zero maintenance
  • It nativelly supports versioning, (it's git-based after all), so you can plan your product releases, then merge and be ready to rock and roll.

Credits

  • Dimitris Tsironis (@tsironis) for concept, design & implementation
  • Jon Romero (@jonromero) for facilitating development process
  • Panagiotis PJ Papadomitsos (@priestjim) for coming up with this awesome name

paradocs's People

Contributors

tsironis avatar

Watchers

Niko Maroulis avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.