Changeset 20539

Show
Ignore:
Timestamp:
10/03/08 02:18:38 (5 years ago)
Author:
kakutani
Message:

documentation and reorganize variables.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • platform/tdiary/plugin/github_badge.rb

    r20535 r20539  
    33# 
    44# usage: 
    5 #   github_badge(github_username) 
    6 #     - github_username: user name on github.com 
     5#   github_badge(username, list_length, head, theme, title, show_all) 
     6#     - username:    user name on github.com 
     7#     - list_length: project list length 
     8#     - theme:       specify theme for badge. "white" or "black". 
     9#     - title:       top text display on the badge. 
     10#     - show_all:    'Show All' message. 
    711# 
    812# Copyright (c) 2008 KAKUTANI Shintaro <http://kakutani.com/> 
    913# Distributed under the GPL 
    1014 
    11 def github_badge( github_username, list_length = 10, github_head = "div", github_theme = "white", github_title = "My Projects", show_all = "Show all" ) 
     15def github_badge( username, list_length = 10, head = "div", theme = "white", title = "My Projects", show_all = "Show all" ) 
    1216        return (<<-EOS).chomp 
    1317<div id="github-badge"></div> 
    1418<script type="text/javascript" charset="utf-8"> 
    15   GITHUB_USERNAME="#{ github_username }"; 
    16   GITHUB_LIST_LENGTH=#{list_length}; 
    17   GITHUB_THEME="#{github_theme}"; 
    18   GITHUB_TITLE="#{github_title}" 
    19   GITHUB_SHOW_ALL = "Show all" 
     19  GITHUB_USERNAME="#{ username }"; 
     20  GITHUB_LIST_LENGTH=#{ list_length }; 
     21  GITHUB_THEME="#{ theme }"; 
     22  GITHUB_TITLE="#{ title }" 
     23  GITHUB_SHOW_ALL = "#{ show_all }" 
    2024</script> 
    2125<script src="http://drnicjavascript.rubyforge.org/github_badge/dist/github-badge-launcher.js" type="text/javascript"></script>