Git Product home page Git Product logo

readme-score's Introduction

ReadmeScore

Build Status Readme Score

Gives a complexity score for a README.

Check scores of any repo in your browser: http://clayallsopp.github.io/readme-score

There's an HTTP API too!

Example score:

Repo Score
https://github.com/RolandasRazma/RRFPSBar Readme Score
https://github.com/JRG-Developer/MediaRSSParser Readme Score
https://github.com/ruslanskorb/RSDayFlow Readme Score
https://github.com/samnung/AFHTTPFileUpdateOperation Readme Score
https://github.com/schneiderandre/ASCFlatUIColor Readme Score
https://github.com/daltoniam/BootstrapUIKit Readme Score
https://github.com/AFNetworking/AFNetworking Readme Score
https://github.com/tomersh/AppleGuice Readme Score
https://github.com/kevindelord/DKHelper Readme Score
https://github.com/saturngod/IAPHelper Readme Score
https://github.com/alskipp/ASValueTrackingSlider Readme Score
https://github.com/phranck/CNTreeNode Readme Score
https://github.com/dasdom/DDHDynamicViewControllerTransitions Readme Score
https://github.com/RestKit/RestKit Readme Score

Installation

Add this line to your application's Gemfile:

gem 'readme-score'

And then execute:

$ bundle

Or install it yourself as:

$ gem install readme-score

Usage

Pass in a URL:

url = "https://raw.githubusercontent.com/AFNetworking/AFNetworking/master/README.md"
score = ReadmeScore.for(url)
score.total_score
# => 95

Pass in a Github Repo:

score = ReadmeScore.for("afnetworking/afnetworking")
score.total_score
# => 95

Pass in HTML:

html = "AFNetworking is a delightful networking library for iOS and Mac OS X...."
score = ReadmeScore.for(html)
score.total_score
# => 95

Configuration

Settings

  • ReadmeScore.use_github_api = <boolean> - whether or not to use the Github API when loading a Github repo's readme. If false, will attempt to find the correct readme URL without the API (which could fail unexpectedly). Defaults to true

  • ReadmeScore.github_api_token = <token> - a token to use with the Github API. Supercedes the ENV variable.

Environment Variables

ENV Description
READMESCORE_GITHUB_TOKEN If scoring a Github repo, ReadmeScore will try to grab the canonical representation via the Github API. By default, unauthenticated requests are limited to 60/hour. Set this env variable to increase that limited to 5k/hour.

readme-score's People

Contributors

clayallsopp avatar tolo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

readme-score's Issues

Crash when processing documents containing <a> tags without href attribute

Hi,

I've recently had issues with cocoapods documentation not being generated for my project InterfaCSS, and I think (not really knowing Ruby and all) I finally managed to track down the problem. It seems that the ruby stacktrace ends on line 62 in filter.rb in readme-score, with the error undefined method 'downcase' for nil:NilClass.

The reason it crashes there seems to be that the script expects that the href attribute is always present in <a> tags, which it isn't in destination anchor tags like <a name="StylesheetFormat">Stylesheet format</a>. So a small nil check there would be lovely.

Cheers,
Tobias

Use Github Markup library instead of Markdown parser

My repository, stevestreza/Relayout, uses a reStructuredText file for its README. ReadmeScore currently is unable to assign a rank to my project because of this, even though rst is a valid README format for GitHub.

The README detection looks to be completely dependent on README files being in the Markdown format. But GitHub supports a variety of formats for README files, including reStructuredText. They also have published a Ruby library that handles converting README files in a variety of formats to HTML.

Since ReadmeScore relies on HTML parsing, not anything specific to Markdown, I would love to see the library changed to support the variety of file formats that GitHub supports, rather than the one used only by a limited subset of repositories.

Thank you!

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.