indentation in citation styles
A bit of a technical question, but I figured might as well ask it here.
Citation styles usually are hierarchically indented to make the xml easier to read.
Those indentations can get messed up for a number of reasons, especially when the style is edited in the test panel.
The question is, what's the fastest way to get the indentation back?
The only way I'm currently able to do that is in emacs nxml mode to go line by line and press tab. That seems very inefficient and silly - there has got to be a better way? Tips, tools, commandlines?
Citation styles usually are hierarchically indented to make the xml easier to read.
Those indentations can get messed up for a number of reasons, especially when the style is edited in the test panel.
The question is, what's the fastest way to get the indentation back?
The only way I'm currently able to do that is in emacs nxml mode to go line by line and press tab. That seems very inefficient and silly - there has got to be a better way? Tips, tools, commandlines?
This is an old discussion that has not been active in a long time. Instead of commenting here, you should start a new discussion. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
=G
with the cursor at the top of the file.cat ugly.csl |tidy -utf8 -xml -w 255 -i -c -q -asxml > pretty.csl
I'm still fighting with the gedit plugin
edit: If anyone cares: I've gotten a nice and workable solution by using the external tools plugin for gedit, and assigning a shortcut to
tidy -utf8 -xml -w 255 -i -c -q -asxml
the tidy plugin for html is useless.
The above strips out all spaces before quotation marks - quite unfortunate for Zotero.
tidy -utf8 -xml -i -q -w --literal-attributes true
seems to do it.
$ xmllint --format foo.csl
See also this blog post for an nxml mode tweak (though I've not used it).