Differences between revisions 1 and 4 (spanning 3 versions)
Revision 1 as of 2011-04-08 02:31:43
Size: 369
Editor: RichardJones
Comment:
Revision 4 as of 2011-08-22 06:23:35
Size: 980
Editor: RichardJones
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
[[http://sphinx.pocoo.org/|Sphinx]] has support for putting an up-to-date Download link in your website using that JSON with one simple "[[https://bitbucket.org/birkenfeld/sphinx-contrib/src/26c8b46f3f3d/cheeseshop/|pypi-release]]" directive. You can use this to automatically generate a link to the latest release of your package with (assuming use of jQuery):

{{{
<span id="release_info" class="note">Download:
  <a href="http://pypi.python.org/pypi/roundup">latest</a></span>
<script type="text/javascript">
 $.getJSON('http://pypi.python.org/pypi/roundup/json?callback=?', function(data) {
     h = 'Download: ' + data.info.version;
     for (var i=0, url; url=data.urls[i]; ++i) {
       h += '<br><a href="' + url.url + '">' + url.filename + '</a>';
     }
     $('#release_info').html(h);
 });
</script>
}}}

[[http://sphinx.pocoo.org/|Sphinx]] has support for putting an up-to-date Download link in your website using that JSON with one simple directive, for example (for the "roundup" package):
{{{
.. pypi-release:: Roundup
   :prefix: Download
   :class: note
}}}

You can access JSON information about packages by using the URL format

You can use this to automatically generate a link to the latest release of your package with (assuming use of jQuery):

<span id="release_info" class="note">Download:
  <a href="http://pypi.python.org/pypi/roundup">latest</a></span>
<script type="text/javascript">
 $.getJSON('http://pypi.python.org/pypi/roundup/json?callback=?', function(data) {
     h = 'Download: ' + data.info.version;
     for (var i=0, url; url=data.urls[i]; ++i) {
       h += '<br><a href="' + url.url + '">' + url.filename + '</a>';
     }
     $('#release_info').html(h);
 });
</script>

Sphinx has support for putting an up-to-date Download link in your website using that JSON with one simple directive, for example (for the "roundup" package):

.. pypi-release:: Roundup
   :prefix: Download
   :class: note

PyPIJSON (last edited 2020-08-31 15:40:46 by JoshCooley)

Unable to edit the page? See the FrontPage for instructions.