Skip to content

Commit

Permalink
updated readme for automated user creation
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed Oct 20, 2011
1 parent 060b709 commit 0ef1a83
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,18 +4,41 @@ I always forget to add an MIT-license.txt file to my projects, so I
wanted to link to a single resource that would always be up to date and wanted to link to a single resource that would always be up to date and
would always have my details online. would always have my details online.


But why keep this to myself, so it's on github for your fork and pulling But why keep this to myself, there's two ways to create your *own* MIT
pleasure. license page:

1. Make a request to the API (details below)
2. Fork this project and send a pull request


Now I can always include http://rem.mit-license.org in all my projects Now I can always include http://rem.mit-license.org in all my projects
which links `rem` (the cname) against my copyright holder name `Remy which links `rem` (the cname) against my copyright holder name `Remy
Sharp` - all stored in the `users` directory. Sharp` - all stored in the `users` directory.


## Example ## Requesting your own MIT license page

You can fork this project, send me a pull request and wait for me to
pull (which I'll do as quickly as possible) or if the user is still
available you can do it yourself from the command line:

curl -d'{ "copyright": "Remy Sharp" }' http://rem.mit-license.org

If the `rem` user isn't taken already, then this will create the new
user file on the fly and the url will be immediately available.

If there's any problems in the automated creation, send me a pull
request and it'll go live soon after.

Equally if you need to update the user file to include more details that
you didn't initially include (extra fields in the next section) you will
need to send a pull request on that `user.json` file via GitHub.

## The user.json file


The `users` directory contains a list of files, each representing a host The `users` directory contains a list of files, each representing a host
on mit-license.org. As present the file format is very simple, but can on mit-license.org. The minimum requirement for the JSON is that is
be upgraded in future. contains a `copyright` field - everything else is optional.

### copyright


Create a new file and give it the name of the CNAME you want (in my case Create a new file and give it the name of the CNAME you want (in my case
it's `rem.json`). This file contains a JSON object containing at least a it's `rem.json`). This file contains a JSON object containing at least a
Expand All @@ -28,6 +51,8 @@ it's `rem.json`). This file contains a JSON object containing at least a
Means I can now link to: http://rem.mit-license.org and it will show my Means I can now link to: http://rem.mit-license.org and it will show my
license name (note that the date will always show the current year). license name (note that the date will always show the current year).


### url

In addition to the `copyright` property, if you want to make a link from In addition to the `copyright` property, if you want to make a link from
the copyright text, you can include a `url` property: the copyright text, you can include a `url` property:


Expand All @@ -36,6 +61,8 @@ the copyright text, you can include a `url` property:
"url": "http://remysharp.com" "url": "http://remysharp.com"
} }


### format

And if you want your license to appear as plain text, just add the And if you want your license to appear as plain text, just add the
`format` property (currently only `txt` and `html` are supported): `format` property (currently only `txt` and `html` are supported):


Expand All @@ -45,10 +72,7 @@ And if you want your license to appear as plain text, just add the
"format": "txt" "format": "txt"
} }


Finally you can also include a license version target in the JSON file ### License version targeting
as explained in the next section.

## License version targeting


License version targeting allows you to link your MIT license to a License version targeting allows you to link your MIT license to a
specific revision in this project - therefore fixing it permanently to specific revision in this project - therefore fixing it permanently to
Expand All @@ -73,7 +97,7 @@ This can also be targeted in my JSON file:
Note that if no version is supplied, the latest copy of the LICENSE.html Note that if no version is supplied, the latest copy of the LICENSE.html
will be displayed with your information included. will be displayed with your information included.


## Themes ### Themes


If you've got an eye for design (or like me: not): you can contribute a If you've got an eye for design (or like me: not): you can contribute a
theme by adding a CSS file to the `themes` directory. The default theme theme by adding a CSS file to the `themes` directory. The default theme
Expand Down

0 comments on commit 0ef1a83

Please sign in to comment.