Skip to content

Commit 9aa7ce3

Browse files
authored
Add norsk-henvisningsstandard-for-rettsvitenskapelige-tekster (#3)
1 parent 78a0dff commit 9aa7ce3

File tree

4 files changed

+761
-0
lines changed

4 files changed

+761
-0
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
--- templates/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster-template.csl
2+
+++ development/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster-full-firstnote.csl
3+
@@ -2,9 +2,9 @@
4+
<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="sort-only" page-range-format="expanded">
5+
<!-- Polyglot; this citation style supports both Norwegian dialects, i.e. bokmål (nb-NO) and nynorsk (nn-NO) -->
6+
<info>
7+
- <title>Norsk henvisningsstandard for rettsvitenskapelige tekster (Norsk - Bokmål | Norsk - Nynorsk) [template]</title>
8+
- <id>http://www.zotero.org/styles/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster</id>
9+
- <link href="http://www.zotero.org/styles/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster" rel="self"/>
10+
+ <title>Norsk henvisningsstandard for rettsvitenskapelige tekster – fullstendig førstenote (Norsk - Bokmål | Norsk - Nynorsk)</title>
11+
+ <id>http://www.zotero.org/styles/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster-full-firstnote</id>
12+
+ <link href="http://www.zotero.org/styles/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster-full-firstnote" rel="self"/>
13+
<link href="http://www.zotero.org/styles/universitetet-i-oslo-rettsvitenskap" rel="template"/>
14+
<link href="https://www.uib.no/sites/w3.uib.no/files/attachments/veiledning_for_henvisning_i_juridiske_tekster.pdf" rel="documentation"/>
15+
<link href="https://obykanalen.no/zotero/" rel="documentation"/>
16+
@@ -18,7 +18,7 @@
17+
</contributor>
18+
<category citation-format="note"/>
19+
<category field="law"/>
20+
- <summary>Norwegian legal citation style based on "Veiledning for henvisninger i juridiske tekster" (February 2019).</summary>
21+
+ <summary>Norwegian legal citation style based on "Veiledning for henvisninger i juridiske tekster" (February 2019). Variant with full note on first citation, subsequent notes in short form (bibliography optional).</summary>
22+
<updated>2026-03-10T22:12:00+00:00</updated>
23+
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
24+
</info>
25+
@@ -517,10 +517,61 @@
26+
<layout delimiter="; ">
27+
<group delimiter=" ">
28+
<choose>
29+
- <if type="book thesis chapter entry-encyclopedia paper-conference article-journal article-newspaper article-magazine post-weblog" match="any">
30+
- <text macro="author-short"/>
31+
- <text macro="issued"/>
32+
+ <if type="book">
33+
+ <choose>
34+
+ <if position="first">
35+
+ <text macro="default-bib"/>
36+
+ </if>
37+
+ <else>
38+
+ <text macro="author-short"/>
39+
+ <text macro="issued"/>
40+
+ </else>
41+
+ </choose>
42+
</if>
43+
+ <else-if type="thesis">
44+
+ <choose>
45+
+ <if position="first">
46+
+ <text macro="thesis-bib"/>
47+
+ </if>
48+
+ <else>
49+
+ <text macro="author-short"/>
50+
+ <text macro="issued"/>
51+
+ </else>
52+
+ </choose>
53+
+ </else-if>
54+
+ <else-if type="chapter entry-encyclopedia paper-conference" match="any">
55+
+ <choose>
56+
+ <if position="first">
57+
+ <text macro="chapter-encyclopediaentry-conferencepaper-bib"/>
58+
+ </if>
59+
+ <else>
60+
+ <text macro="author-short"/>
61+
+ <text macro="issued"/>
62+
+ </else>
63+
+ </choose>
64+
+ </else-if>
65+
+ <else-if type="article-journal">
66+
+ <choose>
67+
+ <if position="first">
68+
+ <text macro="article-journal-bib"/>
69+
+ </if>
70+
+ <else>
71+
+ <text macro="author-short"/>
72+
+ <text macro="issued"/>
73+
+ </else>
74+
+ </choose>
75+
+ </else-if>
76+
+ <else-if type="article-newspaper article-magazine post-weblog" match="any">
77+
+ <choose>
78+
+ <if position="first">
79+
+ <text macro="article-newspaper-magazine-weblog-bib"/>
80+
+ </if>
81+
+ <else>
82+
+ <text macro="author-short"/>
83+
+ <text macro="issued"/>
84+
+ </else>
85+
+ </choose>
86+
+ </else-if>
87+
<else-if type="legislation regulation">
88+
<choose>
89+
<if position="first">
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- templates/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster-template.csl
2+
+++ development/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster.csl
3+
@@ -2,7 +2,7 @@
4+
<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="sort-only" page-range-format="expanded">
5+
<!-- Polyglot; this citation style supports both Norwegian dialects, i.e. bokmål (nb-NO) and nynorsk (nn-NO) -->
6+
<info>
7+
- <title>Norsk henvisningsstandard for rettsvitenskapelige tekster (Norsk - Bokmål | Norsk - Nynorsk) [template]</title>
8+
+ <title>Norsk henvisningsstandard for rettsvitenskapelige tekster – kortnoter (Norsk - Bokmål | Norsk - Nynorsk)</title>
9+
<id>http://www.zotero.org/styles/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster</id>
10+
<link href="http://www.zotero.org/styles/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster" rel="self"/>
11+
<link href="http://www.zotero.org/styles/universitetet-i-oslo-rettsvitenskap" rel="template"/>
12+
@@ -18,7 +18,7 @@
13+
</contributor>
14+
<category citation-format="note"/>
15+
<category field="law"/>
16+
- <summary>Norwegian legal citation style based on "Veiledning for henvisninger i juridiske tekster" (February 2019).</summary>
17+
+ <summary>Norwegian legal citation style based on "Veiledning for henvisninger i juridiske tekster" (February 2019). Variant with short form notes (bibliography required).</summary>
18+
<updated>2026-03-10T22:12:00+00:00</updated>
19+
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
20+
</info>

src/style_variant_builder/build.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ def _process_single_diff(
150150
shutil.copy(template_path, tmp_file.name)
151151
tmp_file_path = Path(tmp_file.name)
152152

153+
# Normalize to LF so patch works regardless of platform line endings
154+
tmp_file_path.write_bytes(
155+
tmp_file_path.read_bytes().replace(b"\r\n", b"\n")
156+
)
157+
153158
patched_file = tmp_file_path
154159
result = subprocess.run(
155160
["patch", "-N", str(patched_file), str(diff_path)],

0 commit comments

Comments
 (0)