Skip to content

Add norsk-henvisningsstandard-for-rettsvitenskapelige-tekster#3

Merged
adunning merged 19 commits intocitation-style-language:mainfrom
StianOby:main
Mar 29, 2026
Merged

Add norsk-henvisningsstandard-for-rettsvitenskapelige-tekster#3
adunning merged 19 commits intocitation-style-language:mainfrom
StianOby:main

Conversation

@StianOby
Copy link
Copy Markdown
Contributor

@StianOby StianOby commented Mar 10, 2026

Adds a template and diffs for two variants of the Norwegian legal citation style "Norsk henvisningsstandard for rettsvitenskapelige tekster".

PS: thanks for this excellent tool. I hope that it is OK to add new styles to the repo, so that others may contribute to the template and diffs too. If you prefer a different way of doing things for those of us wanting to use the style variant builder to publish style variants, please advise.

@StianOby
Copy link
Copy Markdown
Contributor Author

StianOby commented Mar 13, 2026

The two variants generated by the template and diffs added in this PR have now been merged into the CSL styles repo: citation-style-language/styles#8099

Copy link
Copy Markdown
Contributor Author

@StianOby StianOby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just subscribed to Claude pro, and went over this style template with Claude code and made a bunch of minor improvements and bugfixes.

@adunning
Copy link
Copy Markdown
Collaborator

Thank you for contributing this! Interesting that you can get Claude to work: as of last summer, LLMs were completely incapable of writing functional CSL. I'll merge this once it's in the main styles repository, just in case you need to make any further changes.

@StianOby
Copy link
Copy Markdown
Contributor Author

StianOby commented Mar 18, 2026

I installed the Claude extension in VScode and just asked it to review, and gave it the URL of the CSL spec and told it to use your chicago template as a source of best practices. The review it wrote was quite good.

The PR for the main styles repo is here (a version with edits before those i made today has already been merged into the styles repo): citation-style-language/styles#8108

I'm not doing further work at this point in time, so feel free to merge this PR.

@StianOby
Copy link
Copy Markdown
Contributor Author

StianOby commented Mar 19, 2026

I found one additional bug today, and fixed it (e64c99a)

Since I was then working form my Windows laptop, I tried compiling the styles using make in WSL2. But when running make I got a whole bunch of line ending errors. After asking claude to suggest a way to fix this, it came up with the solution in b94d02f

Here is Claude's explanation:

The fix is to normalize the temp file to LF after copying. Since the diff file also has CRLF, it needs the same treatment — but patch already handles that itself (the "stripping trailing CRs" message). The actual failure is the target file still having CRLF while the diff's context lines are now LF.

Fix: after shutil.copy, normalize the temp file to LF: This strips \r\n → \n in the temp copy before patch runs. Since patch already strips CRs from the diff itself, both sides will now be LF and hunks will match.

If the diff files on disk also have CRLF (which they do, confirmed by file), you may also want to normalize the diff used by patch. But patch already advertises it does that ("Stripping trailing CRs from patch") — so the only missing piece was the target file, which this fix addresses.

Please do vet the suggested fix. I don't know python, nor am I familiar with the patching code here. But the fix seemed both useful and simple to review for an expert, like @adunning, so I thought it may be useful to include it.

(Ignore the .gitattributes file, I added it by mistake - it is removed by e86f2fe)

@adunning adunning force-pushed the main branch 2 times, most recently from 760e847 to 47380c0 Compare March 29, 2026 15:30
@adunning adunning force-pushed the main branch 2 times, most recently from 21f76b4 to 78a0dff Compare March 29, 2026 18:41
@adunning adunning merged commit 9aa7ce3 into citation-style-language:main Mar 29, 2026
2 checks passed
@adunning
Copy link
Copy Markdown
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants