From c0c977d5bc0eabd8cc78bcc98214e1a9dad91283 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 23 Oct 2010 15:22:43 -0400 Subject: [PATCH] Add Pybtex post (also: bzr tag, bzrrepo template). --- posts/Pybtex.mdwn | 24 ++++++++++++++++++++++++ tags/bzr.mdwn | 7 +++++++ tags/git.mdwn | 2 +- templates/bzrrepo.mdwn | 16 ++++++++++++++++ templates/gitrepo.mdwn | 2 +- 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 posts/Pybtex.mdwn create mode 100644 tags/bzr.mdwn create mode 100644 templates/bzrrepo.mdwn diff --git a/posts/Pybtex.mdwn b/posts/Pybtex.mdwn new file mode 100644 index 0000000..562f96f --- /dev/null +++ b/posts/Pybtex.mdwn @@ -0,0 +1,24 @@ +[[!template id=bzrrepo repo=pybtex]] + +I keep my [[BibTeX]] databases neat and tidy with my own branch of +[Pybtex][]. The actual command used to re-format the files is + + $ 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 + +Be sure to look over `pybtex.log` and `git diff path/to/db.bib` for +anything suspicious before committing the new file (you are versioning +it with [[Git]] right? ;). You may have to do some find-and-replacing +to handle changed keys and consolidate or rename automatically +generated macros. + +You might also be interested in [bibtool][], but I'm more comfortable +tweaking things in [[Python]]. + + +[Pybtex]: http://pybtex.sourceforge.net/ +[bibtool]: http://www.ctan.org/tex-archive/biblio/bibtex/utils/bibtool/ + + +[[!tag tags/latex]] +[[!tag tags/programming]] +[[!tag tags/tools]] diff --git a/tags/bzr.mdwn b/tags/bzr.mdwn new file mode 100644 index 0000000..156c95b --- /dev/null +++ b/tags/bzr.mdwn @@ -0,0 +1,7 @@ +Software versioned in [Bazaar][] or Bazaar-related posts. I only use +Bazaar when the project I'm hacking already does. When I have a +choice, I much prefer [[posts/Git]] + +[Bazaar]: http://bazaar.canonical.com/ + +[[!inline pages="link(tags/bzr) and !templates/*" show=10 actions=yes]] diff --git a/tags/git.mdwn b/tags/git.mdwn index be271d5..6e7e2d1 100644 --- a/tags/git.mdwn +++ b/tags/git.mdwn @@ -1,3 +1,3 @@ -Software versioned in Git or Git-related posts. +Software versioned in [[posts/Git]] or Git-related posts. [[!inline pages="link(tags/git) and !templates/*" show=10 actions=yes]] diff --git a/templates/bzrrepo.mdwn b/templates/bzrrepo.mdwn new file mode 100644 index 0000000..0401f08 --- /dev/null +++ b/templates/bzrrepo.mdwn @@ -0,0 +1,16 @@ + +Available in a [[!taglink tags/bzr]] repository.
+Repository:
+Author: W. Trevor King
+
+ + +This template is used to create an infobox for a Bazaar repository. It +uses these parameters: + +* repo - the name of the repository. +* url - repository url. Defaults to `/~wking/code/bzr/`. +* author - the author of the branch. Defaults to `W. Trevor King`. + +It also automatically tags the branch with `tags/bzr`. + diff --git a/templates/gitrepo.mdwn b/templates/gitrepo.mdwn index 03e2682..c5eed21 100644 --- a/templates/gitrepo.mdwn +++ b/templates/gitrepo.mdwn @@ -5,7 +5,7 @@ Author: W. Trevor King
-This template is used to create an infobox for a git repository. It +This template is used to create an infobox for a Git repository. It uses these parameters: * repo - the name of the repository. -- 2.26.2