Coder Social home page Coder Social logo

documentup's Introduction

Document Up your Readmes!

Instantly beautify your Github repositories' README.md with DocumentUp. This site has been generated with it.

Essentially, it parses your readme's markdown into a clean and simple documentation website. Made especially for your gh-pages branch, all you need is a single index.html file that includes the DocumentUp script.*

* Some configuration required

Get Started

Simple. Put this recommended setup in your repository's gh-pages' branch's index.html:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/documentup/latest.min.js"></script>
    <script>
      DocumentUp.document("username/repository");
    </script>
  </head>
  <body></body>
</html>

Make sure to change the "username/repository" to the repository's name and user's username.

Known Issues

UTF-8 encoding

This has been fixed in master and deployed to cdnjs. For some reason, latest.js is still cached as the first version of DocumentUp. A quick fix would be to invalidate the cache by using something like that for a script: http://cdnjs.cloudflare.com/ajax/libs/documentup/latest.min.js?0.1.1.

Until this is resolved, I'm not sure what else to do.

Usage

Getting the script

Recommended
Use CDNJS with this script src: http://cdnjs.cloudflare.com/ajax/libs/documentup/latest.min.js

Also good
Download it from this repository There's a minified version of it named documentup.min.js

Instantiation

DocumentUp, in its simplest form, accepts a single argument. A string representing a public repository's "route":

DocumentUp.document("username/repository");

It can be enhanced with an option object like so:

DocumentUp.document({
  repo:  "username/repository",
  color: "green"
});

Options

repo (String) required
Github repository in the form of username/repository

name (String) default: repository name
Name of your project. It'll appear in the header of the sidebar. Defaults to the repository substring of the repo option.

color (String) default: "#336699"
CSS-like color representing the color for the links both in the sidebar and the content.

issues (Boolean or String) default: true Adds a link to the sidebar for the issues tab of the repository if true. Also accepts a string if your issues are managed elsewhere.

travis (Boolean) default: false
Indicate if the project is being tested by Travis-CI. If true, it'll add the small travis badge in the sidebar.

twitter (String or Array of strings) default: null
Add follow buttons for one or more Twitter accounts to your sidebar. Useful to gather followers.

Formatting guide

Just like you normally would. DocumentUp also supports "Github Flavored Markdown" and we recommend you use it for syntax highlighting.

h1's (# in markdown) will appear as first level navigation in the sidebar while h2's (##) will appear under them as sub-navigation.

Example:

# Project name / Title (won't appear in the sidebar)

Some intro text if you want.

## Top level-navigation

### Sub-navigation

#### This wouldn't show up in the sidebar

Tests

Using Mocha and chai.

All still very much a work in progress, run the tests in your browser here: spec/index.html

Contributions are welcome

If you're a designer or coder and would like to contribute new styles, new features or bug fixes, please don't keep them to yourself, fork the project and send in a pull request!

Local development

Requirements

  • Node.js (preferrably > 0.6)
  • npm

Project structure

src/browser/documentup.coffee: DocumentUp Class definition
src/stylesheets/screen.styl: Styles for the documentation

Setup your environment

Simply npm install

Build cool shit

When you're done, ./scripts/package to package everything into a single file.

Roadmap

  • iOS and IE8+ compatibility
  • Themes
  • Bring Your Own Markdown Source
  • Multi-page aggregation

Thank you

  • Thanks for the few well documented project sites out there for the inspiration.
  • Thanks to CDNJS for being so helpful and hosting this project.

Changelog

0.1.1 (Jan 26, 2012)

  • Files now parsed in UTF-8
  • Namespaced repositories in localStorage (thanks to tbranyen)
  • A few README fixes

0.1.0 (Jan 25, 2012)

  • http://cdnjs.cloudflare.com/ajax/libs/documentup/0.1.0/documentup.min.js
  • Initial release

License

Copyright (c) 2012 Jerome Gravel-Niquet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

documentup's People

Contributors

gilesbowkett avatar jeromegn avatar rafbm avatar soopercorp avatar tbranyen avatar will avatar

Stargazers

 avatar

Watchers

 avatar  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.