Skip to content

Commit 86cc038

Browse files
committed
plugins/obsidian: move deprecations
1 parent e68b8e9 commit 86cc038

File tree

2 files changed

+176
-166
lines changed

2 files changed

+176
-166
lines changed

plugins/by-name/obsidian/default.nix

Lines changed: 5 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -14,172 +14,11 @@ lib.nixvim.plugins.mkNeovimPlugin {
1414

1515
## DEPRECATIONS
1616
# Introduced 2024-03-12
17-
# TODO: remove 2024-05-12
18-
deprecateExtraOptions = true;
19-
optionsRenamedToSettings = [
20-
"dir"
21-
"logLevel"
22-
"notesSubdir"
23-
[
24-
"templates"
25-
"subdir"
26-
]
27-
[
28-
"templates"
29-
"dateFormat"
30-
]
31-
[
32-
"templates"
33-
"timeFormat"
34-
]
35-
[
36-
"templates"
37-
"substitutions"
38-
]
39-
"noteIdFunc"
40-
"followUrlFunc"
41-
"noteFrontmatterFunc"
42-
"disableFrontmatter"
43-
[
44-
"completion"
45-
"nvimCmp"
46-
]
47-
[
48-
"completion"
49-
"minChars"
50-
]
51-
"mappings"
52-
[
53-
"dailyNotes"
54-
"folder"
55-
]
56-
[
57-
"dailyNotes"
58-
"dateFormat"
59-
]
60-
[
61-
"dailyNotes"
62-
"aliasFormat"
63-
]
64-
[
65-
"dailyNotes"
66-
"template"
67-
]
68-
"useAdvancedUri"
69-
"openAppForeground"
70-
"sortBy"
71-
"sortReversed"
72-
"openNotesIn"
73-
[
74-
"ui"
75-
"enable"
76-
]
77-
[
78-
"ui"
79-
"updateDebounce"
80-
]
81-
[
82-
"ui"
83-
"externalLinkIcon"
84-
"char"
85-
]
86-
[
87-
"ui"
88-
"externalLinkIcon"
89-
"hlGroup"
90-
]
91-
[
92-
"ui"
93-
"referenceText"
94-
"hlGroup"
95-
]
96-
[
97-
"ui"
98-
"highlightText"
99-
"hlGroup"
100-
]
101-
[
102-
"ui"
103-
"tags"
104-
"hlGroup"
105-
]
106-
[
107-
"ui"
108-
"hlGroups"
109-
]
110-
[
111-
"attachments"
112-
"imgFolder"
113-
]
114-
[
115-
"attachments"
116-
"imgTextFunc"
117-
]
118-
"yamlParser"
119-
{
120-
old = "finder";
121-
new = [
122-
"settings"
123-
"picker"
124-
"name"
125-
];
126-
}
127-
# https://github.com/epwalsh/obsidian.nvim/blob/656d9c2c64528839db8b2d9a091843b3c90155a2/CHANGELOG.md?plain=1#L184
128-
{
129-
old = [
130-
"completion"
131-
"newNotesLocation"
132-
];
133-
new = "new_notes_location";
134-
}
135-
];
136-
imports =
137-
let
138-
basePluginPath = [
139-
"plugins"
140-
"obsidian"
141-
];
142-
in
143-
[
144-
(
145-
# We have to remove the option here because the user could set old-style camelCase options in each workspaces element.
146-
mkRemovedOptionModule (
147-
basePluginPath ++ [ "workspaces" ]
148-
) "Please use `plugins.obsidian.settings.workspaces` instead."
149-
)
150-
(
151-
# We have to remove the option here because the user could set old-style camelCase options in each checkbox element.
152-
mkRemovedOptionModule (
153-
basePluginPath
154-
++ [
155-
"ui"
156-
"checkboxes"
157-
]
158-
) "Please use `plugins.obsidian.settings.ui.checkboxes` instead."
159-
)
160-
]
161-
++ (map
162-
(
163-
optionPath:
164-
mkRemovedOptionModule (basePluginPath ++ optionPath) "This option was deprecated by upstream."
165-
)
166-
[
167-
[ "detectCwd" ]
168-
[ "backlinks" ]
169-
[
170-
"completion"
171-
"prependNoteId"
172-
]
173-
[
174-
"completion"
175-
"prependNotePath"
176-
]
177-
[
178-
"completion"
179-
"usePathOnly"
180-
]
181-
]
182-
);
17+
inherit (import ./deprecations.nix { inherit lib; })
18+
imports
19+
deprecateExtraOptions
20+
optionsRenamedToSettings
21+
;
18322

18423
settingsOptions =
18524
let
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
{ lib, ... }:
2+
let
3+
inherit (lib) mkRemovedOptionModule;
4+
in
5+
{
6+
deprecateExtraOptions = true;
7+
optionsRenamedToSettings = [
8+
"dir"
9+
"logLevel"
10+
"notesSubdir"
11+
[
12+
"templates"
13+
"subdir"
14+
]
15+
[
16+
"templates"
17+
"dateFormat"
18+
]
19+
[
20+
"templates"
21+
"timeFormat"
22+
]
23+
[
24+
"templates"
25+
"substitutions"
26+
]
27+
"noteIdFunc"
28+
"followUrlFunc"
29+
"noteFrontmatterFunc"
30+
"disableFrontmatter"
31+
[
32+
"completion"
33+
"nvimCmp"
34+
]
35+
[
36+
"completion"
37+
"minChars"
38+
]
39+
"mappings"
40+
[
41+
"dailyNotes"
42+
"folder"
43+
]
44+
[
45+
"dailyNotes"
46+
"dateFormat"
47+
]
48+
[
49+
"dailyNotes"
50+
"aliasFormat"
51+
]
52+
[
53+
"dailyNotes"
54+
"template"
55+
]
56+
"useAdvancedUri"
57+
"openAppForeground"
58+
"sortBy"
59+
"sortReversed"
60+
"openNotesIn"
61+
[
62+
"ui"
63+
"enable"
64+
]
65+
[
66+
"ui"
67+
"updateDebounce"
68+
]
69+
[
70+
"ui"
71+
"externalLinkIcon"
72+
"char"
73+
]
74+
[
75+
"ui"
76+
"externalLinkIcon"
77+
"hlGroup"
78+
]
79+
[
80+
"ui"
81+
"referenceText"
82+
"hlGroup"
83+
]
84+
[
85+
"ui"
86+
"highlightText"
87+
"hlGroup"
88+
]
89+
[
90+
"ui"
91+
"tags"
92+
"hlGroup"
93+
]
94+
[
95+
"ui"
96+
"hlGroups"
97+
]
98+
[
99+
"attachments"
100+
"imgFolder"
101+
]
102+
[
103+
"attachments"
104+
"imgTextFunc"
105+
]
106+
"yamlParser"
107+
{
108+
old = "finder";
109+
new = [
110+
"settings"
111+
"picker"
112+
"name"
113+
];
114+
}
115+
# https://github.com/epwalsh/obsidian.nvim/blob/656d9c2c64528839db8b2d9a091843b3c90155a2/CHANGELOG.md?plain=1#L184
116+
{
117+
old = [
118+
"completion"
119+
"newNotesLocation"
120+
];
121+
new = "new_notes_location";
122+
}
123+
];
124+
imports =
125+
let
126+
basePluginPath = [
127+
"plugins"
128+
"obsidian"
129+
];
130+
in
131+
[
132+
(
133+
# We have to remove the option here because the user could set old-style camelCase options in each workspaces element.
134+
mkRemovedOptionModule (
135+
basePluginPath ++ [ "workspaces" ]
136+
) "Please use `plugins.obsidian.settings.workspaces` instead."
137+
)
138+
(
139+
# We have to remove the option here because the user could set old-style camelCase options in each checkbox element.
140+
mkRemovedOptionModule (
141+
basePluginPath
142+
++ [
143+
"ui"
144+
"checkboxes"
145+
]
146+
) "Please use `plugins.obsidian.settings.ui.checkboxes` instead."
147+
)
148+
]
149+
++ (map
150+
(
151+
optionPath:
152+
mkRemovedOptionModule (basePluginPath ++ optionPath) "This option was deprecated by upstream."
153+
)
154+
[
155+
[ "detectCwd" ]
156+
[ "backlinks" ]
157+
[
158+
"completion"
159+
"prependNoteId"
160+
]
161+
[
162+
"completion"
163+
"prependNotePath"
164+
]
165+
[
166+
"completion"
167+
"usePathOnly"
168+
]
169+
]
170+
);
171+
}

0 commit comments

Comments
 (0)