Examples of concrete use of some hidden features of Bitbucket¶
Avertissement
Javascript is required!
This web page embeds some small programs written in javascript. This should work in any recent web browser, supporting javascript (and it should not be disabled).
About this page¶
This page demonstrates some hidden features of the awesome website Bitbucket (you know, the Australian concurrent of GitHub, to which I participated in his French translation and that I enjoy very much).
Direct links¶
Complete historic for a file¶
For example: for my script bin/PDFCompress.
To a specific line¶
For example: for my file .bashrc, directly to the line 441.
Direct file¶
For example: for my script bin/series.sh.
Include a file with ?t=embed
¶
How does it work?¶
Pattern¶
Bitbucket.org allows to include a file (with syntax coloring)
easily, with the following piece of HTML
code:
<script type="text/javascript" src="https://bitbucket.org/NAME/REPOSITORY/src/master/PATH?t=embed"></script>
Example¶
You have to replace:
NAME
by your Bitbucket username (for me, it is lbesson);
REPOSITORY
by the name of the repository (for instance, for me, bin);
PATH
by the complete path to the file (for instance, pdflatex which is also here bin/pdflatex localement).
And so, in the example below, the HTML
code embedded is:
<script type="text/javascript" src="https://bitbucket.org/lbesson/src/master/pdflatex?t=embed"></script>
In reStructuredText¶
And finally, we can include this in a webpage generated with Sphinx thanks to the following piece of rST
code:
.. raw:: html
<script type="text/javascript" src="https://bitbucket.org/lbesson/src/master/pdflatex?embed=t">File bin/pdflatex</script>
<noscript>Javascript is disabled, impossible to include this file <a href="https://bitbucket.org/lbesson/raw/master/pdflatex">bin/pdflatex</a>.</noscript>