tags/bzrunfolding disastershttp://blog.tremily.us//tags/bzr/unfolding disastersikiwiki2010-11-09T17:38:37ZPybtexhttp://blog.tremily.us//posts/Pybtex/2010-10-23T19:27:11Z2010-10-23T19:22:43Z
<p><span class="infobox">
Available in a <span class="selflink">bzr</span> repository.<br />
Repository: <a href="https://code.launchpad.net/~wking-drexel/pybtex/" rel="vcs-bzr" title="pybtex repository">pybtex</a><br />
Author: W. Trevor King<br />
</span></p>
<p>I keep my <a href="http://blog.tremily.us//tags/bzr/../../posts/BibTeX/">BibTeX</a> databases neat and tidy with my own branch of
<a href="http://pybtex.sourceforge.net/">Pybtex</a>. The actual command used to re-format the files is</p>
<pre><code>$ python -c 'from pybtex.database.input.bibtex import Parser; from pybtex.database.output.clean_bibtex import Writer; p = Parser(); d = p.parse_file("path/to/db.bib"); w = Writer(); w.write_file(d, "path/to/db.bib", p.get_raw_macros())' 2> pybtex.log
</code></pre>
<p>Be sure to look over <code>pybtex.log</code> and <code>git diff path/to/db.bib</code> for
anything suspicious before committing the new file (you are versioning
it with <a href="http://blog.tremily.us//tags/bzr/../../posts/Git/">Git</a> right? ;). You may have to do some find-and-replacing
to handle changed keys and consolidate or rename automatically
generated macros.</p>
<p>You might also be interested in <a href="http://www.ctan.org/tex-archive/biblio/bibtex/utils/bibtool/">bibtool</a>, but I'm more comfortable
tweaking things in <a href="http://blog.tremily.us//tags/bzr/../../posts/Python/">Python</a>.</p>
rel-vcshttp://blog.tremily.us//posts/rel-vcs/2010-11-09T17:38:37Z2010-10-08T03:20:04Z
<p>Since I publish a lot of <a href="http://blog.tremily.us//tags/bzr/../../posts/Git/">Git</a> packages, I was interested to read
about <a href="http://kitenet.net/~joey/">Joey Hess</a>' <a href="http://kitenet.net/~joey/rfc/rel-vcs/">rel=vcs-* microformat</a>. I think
recording the location of the repo sorcing a page is a great idea, but
with the link stashed in the page header, I could easily browse on by
without ever noticing that the link existed.</p>
<p>This looks like the same sort of problem that the <a href="http://sioc-project.org/firefox">Semantic Radar</a>
extension was designed to solve, except the SR extension notifies you
about RDF files (SIOC, <a href="http://blog.tremily.us//tags/bzr/../../posts/FOAF/">FOAF</a>, DOAP, etc.). I've altered the SR
extension to identify the <code>rel=vcs-*</code> tags.</p>
<p>The <span class="createlink">rel-vcs</span> extension places an icon in your Firefox
statusbar which goes "hot" when a page has <code>rel=vcs-*</code> tags and "cold"
otherwise. When the icon is "hot", you can click on it to pop up a
list of rel-vcs links. Clicking on an item in the list will open that
URI in a new tab. Since Firefox can't speak <code>git://</code> etc., the new
tab will mostly be useful as a source of the URI for copy/pasting into
a <code>git clone ...</code> call or similar. Alternatively, you can consider
the "hot" icon as a suggestion to use <code>webcheckout</code> or other
<code>rel=vcs-*</code> consumer on the source page.</p>