Suggestion: Use Hypermedia. Advantage: your choice of URI does not matter.
If you provide sources in a visible way to your end user during the normal use of your web application:
<a target="_blank" href="http://www.example.com/css/styles.css" rel="sourcecode" title="The non-minified CSS source."> Click here for CSS source code. </a> <a target="_blank" href="http://www.example.com/scripts/buttons.js" rel="sourcecode" title="The non-minified JavaScript source."> Click here for JavaScript source code. </a>
If you provide sources for developer users outside of their normal use of the web application, it might make sense to link to them in an invisible section of the source:
<link rel="sourcecode" type="text/css" href="http://www.example.com/css/styles.css" title="The non-minified CSS source." /> <link rel="sourcecode" type="text/javascript" href="http://www.example.com/scripts/buttons.js" title="The non-minified JavaScript source." />
These links will only be available to developers who are considering the HTML source, or to people who have really tricked user agents.
On the same lines, you can put the source without restrictions (but not JS) as an alternative stylesheet.
Note: rel="sourcecode" not a standard (I just finished), but I am sure that it does not violate the specification; and along with the title it helps communicate the purpose of the link.
source share