This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
import glob | |
import os | |
import xml.etree.ElementTree as ET | |
# from lxml import etree as ET | |
import yaml | |
CSL_STYLES_DIR = '../styles' | |
NSMAP = {'cs': 'http://purl.org/net/xbiblio/csl'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Multi-level sort a slice of Foobars according to [(field, reverse)] | |
fn sort_by_names(f: &mut [Foobar], orderings: &[(Foofields, bool)]) { | |
use std::cmp::Ordering; | |
f.sort_by(|a, b| { | |
let mut cmp = Ordering::Equal; | |
for (field, reverse) in orderings { | |
if cmp != Ordering::Equal { | |
break; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---- | |
+p_xml: version="1.0" encoding="utf-8" | |
style: | |
xmlns: http://purl.org/net/xbiblio/csl | |
class: in-text | |
version: "1.0" | |
demote-non-dropping-particle: never | |
page-range-format: expanded | |
info: | |
title: American Psychological Association 7th edition |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was generated from JSON Schema using quicktype, do not modify it directly. | |
// To parse and unparse this JSON data, add this code to your project and do: | |
// | |
// localizationTerms, err := UnmarshalLocalizationTerms(bytes) | |
// bytes, err = localizationTerms.Marshal() | |
// | |
// lang, err := UnmarshalLang(bytes) | |
// bytes, err = lang.Marshal() | |
// | |
// localizedTermName, err := UnmarshalLocalizedTermName(bytes) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- author-short | |
- author-short-bibliography | |
- author | |
- editor-translator | |
- container-title | |
- edition | |
- journal-details | |
- pages | |
- title | |
- year-date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PREFIX="pre-commit:" | |
fileList=$(git diff --diff-filter=d --cached --name-only) | |
includeFileList=$(echo "$fileList" | grep -E '\.(ts)$') | |
if [ ${#includeFileList} -gt 0 ]; then | |
if ! deno fmt --check ${includeFileList[*]} "$@"; then | |
echo "$PREFIX Commit aborted." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"locale": { | |
"xmlns": "http://purl.org/net/xbiblio/csl", | |
"version": "1.0", | |
"xml:lang": "en-US", | |
"info": { | |
"translator": [ | |
{"name": "Andrew Dunning"}, | |
{"name": "Sebastian Karcher"}, | |
{"name": "Rintze M. Zelle"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> | |
<uri pattern="*.csl" typeId="CSL"/> | |
<namespace ns="http://purl.org/net/xbiblio/csl" typeId="CSL"/> | |
<typeId id="CSL" uri="~/Code/csl/schemas/schemas/csl.rnc"/> | |
</locatingRules> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$schema: http://json-schema.org/draft-06/schema# | |
$ref: '#/definitions/bibreference' | |
definitions: | |
bibreference: | |
type: object | |
additionalProperties: false | |
properties: | |
author: | |
type: string | |
bookauthor: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
# use biber to handle conversion, but ensure input is utf-8 first | |
iconv -t utf-8 "${1}" | |
biber --tool --tool-fieldcase='lower' --quiet -O "${1}" "${1}" | |
# tidy the final file | |
bibtex-tidy --sort-fields --curly --numeric --align=13 --sort=key --duplicates=key --no-escape --no-remove-dupe-fields --generate-keys="[auth:required:lower][year:required]" ${1} |
NewerOlder