Skip to content

Commit

Permalink
update dc_code and dc_law permalink modules
Browse files Browse the repository at this point in the history
* rename the `dccode` linker to `dc_council`
* fix its dc_law linker function -- it was incorrectly applied to dc_code citations, and the URLs have changed to https://beta.code.dccouncil.us
* add a dc_code linker function to https://beta.code.dccouncil.us
* drop the dccodeorg and dcdecoded linkers since the sites are no longer maintained
  • Loading branch information
JoshData committed Aug 12, 2016
1 parent 84e843f commit af93e93
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 65 deletions.
4 changes: 1 addition & 3 deletions citation.js
Expand Up @@ -421,9 +421,7 @@ if (typeof(require) !== "undefined") {

Citation.links.cornell_lii = require("./links/cornell_lii");
Citation.links.courtlistener = require("./links/courtlistener");
Citation.links.dccode = require("./links/dccode");
Citation.links.dccodeorg = require("./links/dccodeorg");
Citation.links.dcdecoded = require("./links/dcdecoded");
Citation.links.dc_council = require("./links/dc_council");
Citation.links.govtrack = require("./links/govtrack");
Citation.links.gpo = require("./links/gpo");
Citation.links.house = require("./links/house");
Expand Down
22 changes: 22 additions & 0 deletions links/dc_council.js
@@ -0,0 +1,22 @@
module.exports = {
id: "dc_council",

name: "Council of the District of Columbia",
abbreviation: "DC Council",
link: "https://dccode.gov",

authoritative: true,

citations: {
dc_law: function(cite) {
return {
landing: "https://beta.code.dccouncil.us/dc/council/laws/" + cite.period + "-" + cite.number + ".html"
};
},
dc_code: function(cite) {
return {
landing: "https://beta.code.dccouncil.us/dc/council/code/sections/" + cite.title + "-" + cite.section + ".html"
};
}
}
};
19 changes: 0 additions & 19 deletions links/dccode.js

This file was deleted.

17 changes: 0 additions & 17 deletions links/dccodeorg.js

This file was deleted.

17 changes: 0 additions & 17 deletions links/dcdecoded.js

This file was deleted.

18 changes: 9 additions & 9 deletions test/dc_code.js
Expand Up @@ -12,49 +12,49 @@ exports["Relative patterns"] = function(test) {
[ 'standard',
'as that term is defined in § 32-701(4), to the deceased',
'§ 32-701(4)',
'32', '701', ['4'], "http://dccode.org/simple/sections/32-701.html"],
'32', '701', ['4'], "https://beta.code.dccouncil.us/dc/council/code/sections/32-701.html"],

// in 3-101 of the DC Code:
[ 'into-newline',
'as provided in § 1-603.01(13).\n\n(b) In addition to the',
'§ 1-603.01(13)',
'1', '603.01', ['13'], "http://dccode.org/simple/sections/1-603.01.html"],
'1', '603.01', ['13'], "https://beta.code.dccouncil.us/dc/council/code/sections/1-603.01.html"],

// in 3-101 of the DC Code
[ 'section-with-dot',
'required under § 3-101.01, the Commission',
'§ 3-101.01',
'3', '101.01', [], "http://dccode.org/simple/sections/3-101.01.html"],
'3', '101.01', [], "https://beta.code.dccouncil.us/dc/council/code/sections/3-101.01.html"],

// in 1-611.1 of the DC Code
[ 'section-ending-with-dot',
'accordance with the policies of § 1-611.01.',
'§ 1-611.01',
'1', '611.01', [], "http://dccode.org/simple/sections/1-611.01.html"],
'1', '611.01', [], "https://beta.code.dccouncil.us/dc/council/code/sections/1-611.01.html"],

// in 1-1163.20 of the DC Code
[ 'section-forgiving-with-space',
'contribution limits for the candidate as provided under § 1- 1163.33.',
'§ 1- 1163.33',
'1', '1163.33', [], "http://dccode.org/simple/sections/1-1163.33.html"],
'1', '1163.33', [], "https://beta.code.dccouncil.us/dc/council/code/sections/1-1163.33.html"],

// hypothetical (modified from 1-1163.20 of the DC Code)
[ 'section-forgiving-with-space',
'contribution limits for the candidate as provided under § 1 -1163.33.',
'§ 1 -1163.33',
'1', '1163.33', [], "http://dccode.org/simple/sections/1-1163.33.html"],
'1', '1163.33', [], "https://beta.code.dccouncil.us/dc/council/code/sections/1-1163.33.html"],

// hypothetical (modified from 1-1163.20 of the DC Code)
[ 'section-forgiving-no-space',
'contribution limits for the candidate as provided under §1-1163.33.',
'§1-1163.33',
'1', '1163.33', [], "http://dccode.org/simple/sections/1-1163.33.html"],
'1', '1163.33', [], "https://beta.code.dccouncil.us/dc/council/code/sections/1-1163.33.html"],

// in 16-316 of the DC Code
[ 'section-with-word-section',
'case shall be subject to the limitation set forth in [section 16-2326.01(b)(2)].',
'section 16-2326.01(b)(2)',
'16', '2326.01', ['b', '2'], "http://dccode.org/simple/sections/16-2326.01.html"]
'16', '2326.01', ['b', '2'], "https://beta.code.dccouncil.us/dc/council/code/sections/16-2326.01.html"]
];

for (var i=0; i<cases.length; i++) {
Expand All @@ -77,7 +77,7 @@ exports["Relative patterns"] = function(test) {
test.equal(citation.dc_code.title, details[3]);
test.equal(citation.dc_code.section, details[4]);
test.deepEqual(citation.dc_code.subsections, details[5]);
test.equal(citation.dc_code.links.dccodeorg.landing, details[6]);
test.equal(citation.dc_code.links.dc_council && citation.dc_code.links.dc_council.landing, details[6]);
} else
console.log("No match found in: " + text);

Expand Down

0 comments on commit af93e93

Please sign in to comment.