You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/openapi.yaml
+6-96Lines changed: 6 additions & 96 deletions
Original file line number
Diff line number
Diff line change
@@ -153,6 +153,8 @@ paths:
153
153
154
154
Allows you to modify the content relative to a heading, block reference, or frontmatter field in your document.
155
155
156
+
Note that this API was changed in Version 3.0 of this extension and the earlier PATCH API is now deprecated. Requests made using the previous version of this API will continue to work until Version 4.0 is released. See https://github.com/coddingtonbear/obsidian-local-rest-api/wiki/Changes-to-PATCH-requests-between-versions-2.0-and-3.0 for more details and migration instructions.
157
+
156
158
# Examples
157
159
158
160
All of the below examples assume you have a document that looks like
@@ -276,38 +278,6 @@ paths:
276
278
interpreting yoru `prepend` or `append` requests if you specify
277
279
your data as JSON (particularly when appending, for example,
278
280
list items).
279
-
280
-
# Upgrading from Version 2.0 (heading-based) to Version 3.0 (target-based) APIs
281
-
282
-
This API was changed in version 3.0 of Obsidian Local REST API to support making changes to your document relative to ["block references"](https://help.obsidian.md/Linking+notes+and+files/Internal+links#Link+to+a+block+in+a+note) and frontmatter fields in addition to headings within your document.
283
-
Version 2.0 of this API (now undocumented) is still accessible as
284
-
long as your incoming request specifies the `Heading` header and
285
-
*does not* specify a `Target-Type` header. You should upgrade, though,
286
-
to the current version of the API as support for the Version 2.0 API is
287
-
now deprecated and will stop working in Version 4.0.
288
-
289
-
You can migrate to the current version of the API by following the below guidelines. The words "heading" and "header" both occur quite a lot in the below paragraphs so it may aid in your understanding if you keep in mind that "head**ing**" here refers to a heading existing within your markdown document and "head**er**" refers to an HTTP Header that you may set to a value as part of using this API.
290
-
291
-
1. Rename your `Heading` header to `Target`.
292
-
2. Add a new `Target-Type` header having the value `heading`.
293
-
3. Set the `Operation` header such that its value is `append` if you had either not set the `Content-Insertion-Position` header or had set it to `end`. Set it to `prepend` if you had set `Content-Insertion-Position` to `beginning`.
294
-
4. If you had set `Content-Insertion-Ignore-Newline` to `true`, set the `Trim-Target-Whitespace` header value to `true` also.
295
-
296
-
Aside from the above, there is one important thing to keep in mind: while the obsolete version of this API allowed you to specify just the terminal heading (e.g. content under `### My Heading` could be addressed by setting the `Heading` header to `My Heading`), the current version of this API requires that you provide the full path to your target heading (i.e. instead of `My Heading`, you must find the parent second level heading and and its parent top level heading) delimited by `::`. If `::` appears in your heading, you can override that value by setting the `Target-Delimiter` header.
297
-
298
-
For example, if you had previously set `Heading` to `My Heading` for adding content to "MY CONTENT" in a document like:
299
-
300
-
```markdown
301
-
# Some top-level heading
302
-
303
-
## Some second-level heading
304
-
305
-
### My Heading
306
-
307
-
MY CONTENT
308
-
```
309
-
310
-
you should now set yoru `Target` heading to `Some top-level heading::Some second-level heading::My Heading`.
311
281
parameters:
312
282
- description: "Patch operation to perform"
313
283
in: "header"
@@ -627,6 +597,8 @@ paths:
627
597
628
598
Allows you to modify the content relative to a heading, block reference, or frontmatter field in your document.
629
599
600
+
Note that this API was changed in Version 3.0 of this extension and the earlier PATCH API is now deprecated. Requests made using the previous version of this API will continue to work until Version 4.0 is released. See https://github.com/coddingtonbear/obsidian-local-rest-api/wiki/Changes-to-PATCH-requests-between-versions-2.0-and-3.0 for more details and migration instructions.
601
+
630
602
# Examples
631
603
632
604
All of the below examples assume you have a document that looks like
@@ -750,38 +722,6 @@ paths:
750
722
interpreting yoru `prepend` or `append` requests if you specify
751
723
your data as JSON (particularly when appending, for example,
752
724
list items).
753
-
754
-
# Upgrading from Version 2.0 (heading-based) to Version 3.0 (target-based) APIs
755
-
756
-
This API was changed in version 3.0 of Obsidian Local REST API to support making changes to your document relative to ["block references"](https://help.obsidian.md/Linking+notes+and+files/Internal+links#Link+to+a+block+in+a+note) and frontmatter fields in addition to headings within your document.
757
-
Version 2.0 of this API (now undocumented) is still accessible as
758
-
long as your incoming request specifies the `Heading` header and
759
-
*does not* specify a `Target-Type` header. You should upgrade, though,
760
-
to the current version of the API as support for the Version 2.0 API is
761
-
now deprecated and will stop working in Version 4.0.
762
-
763
-
You can migrate to the current version of the API by following the below guidelines. The words "heading" and "header" both occur quite a lot in the below paragraphs so it may aid in your understanding if you keep in mind that "head**ing**" here refers to a heading existing within your markdown document and "head**er**" refers to an HTTP Header that you may set to a value as part of using this API.
764
-
765
-
1. Rename your `Heading` header to `Target`.
766
-
2. Add a new `Target-Type` header having the value `heading`.
767
-
3. Set the `Operation` header such that its value is `append` if you had either not set the `Content-Insertion-Position` header or had set it to `end`. Set it to `prepend` if you had set `Content-Insertion-Position` to `beginning`.
768
-
4. If you had set `Content-Insertion-Ignore-Newline` to `true`, set the `Trim-Target-Whitespace` header value to `true` also.
769
-
770
-
Aside from the above, there is one important thing to keep in mind: while the obsolete version of this API allowed you to specify just the terminal heading (e.g. content under `### My Heading` could be addressed by setting the `Heading` header to `My Heading`), the current version of this API requires that you provide the full path to your target heading (i.e. instead of `My Heading`, you must find the parent second level heading and and its parent top level heading) delimited by `::`. If `::` appears in your heading, you can override that value by setting the `Target-Delimiter` header.
771
-
772
-
For example, if you had previously set `Heading` to `My Heading` for adding content to "MY CONTENT" in a document like:
773
-
774
-
```markdown
775
-
# Some top-level heading
776
-
777
-
## Some second-level heading
778
-
779
-
### My Heading
780
-
781
-
MY CONTENT
782
-
```
783
-
784
-
you should now set yoru `Target` heading to `Some top-level heading::Some second-level heading::My Heading`.
785
725
parameters:
786
726
- description: "Patch operation to perform"
787
727
in: "header"
@@ -1259,6 +1199,8 @@ paths:
1259
1199
1260
1200
Allows you to modify the content relative to a heading, block reference, or frontmatter field in your document.
1261
1201
1202
+
Note that this API was changed in Version 3.0 of this extension and the earlier PATCH API is now deprecated. Requests made using the previous version of this API will continue to work until Version 4.0 is released. See https://github.com/coddingtonbear/obsidian-local-rest-api/wiki/Changes-to-PATCH-requests-between-versions-2.0-and-3.0 for more details and migration instructions.
1203
+
1262
1204
# Examples
1263
1205
1264
1206
All of the below examples assume you have a document that looks like
@@ -1382,38 +1324,6 @@ paths:
1382
1324
interpreting yoru `prepend` or `append` requests if you specify
1383
1325
your data as JSON (particularly when appending, for example,
1384
1326
list items).
1385
-
1386
-
# Upgrading from Version 2.0 (heading-based) to Version 3.0 (target-based) APIs
1387
-
1388
-
This API was changed in version 3.0 of Obsidian Local REST API to support making changes to your document relative to ["block references"](https://help.obsidian.md/Linking+notes+and+files/Internal+links#Link+to+a+block+in+a+note) and frontmatter fields in addition to headings within your document.
1389
-
Version 2.0 of this API (now undocumented) is still accessible as
1390
-
long as your incoming request specifies the `Heading` header and
1391
-
*does not* specify a `Target-Type` header. You should upgrade, though,
1392
-
to the current version of the API as support for the Version 2.0 API is
1393
-
now deprecated and will stop working in Version 4.0.
1394
-
1395
-
You can migrate to the current version of the API by following the below guidelines. The words "heading" and "header" both occur quite a lot in the below paragraphs so it may aid in your understanding if you keep in mind that "head**ing**" here refers to a heading existing within your markdown document and "head**er**" refers to an HTTP Header that you may set to a value as part of using this API.
1396
-
1397
-
1. Rename your `Heading` header to `Target`.
1398
-
2. Add a new `Target-Type` header having the value `heading`.
1399
-
3. Set the `Operation` header such that its value is `append` if you had either not set the `Content-Insertion-Position` header or had set it to `end`. Set it to `prepend` if you had set `Content-Insertion-Position` to `beginning`.
1400
-
4. If you had set `Content-Insertion-Ignore-Newline` to `true`, set the `Trim-Target-Whitespace` header value to `true` also.
1401
-
1402
-
Aside from the above, there is one important thing to keep in mind: while the obsolete version of this API allowed you to specify just the terminal heading (e.g. content under `### My Heading` could be addressed by setting the `Heading` header to `My Heading`), the current version of this API requires that you provide the full path to your target heading (i.e. instead of `My Heading`, you must find the parent second level heading and and its parent top level heading) delimited by `::`. If `::` appears in your heading, you can override that value by setting the `Target-Delimiter` header.
1403
-
1404
-
For example, if you had previously set `Heading` to `My Heading` for adding content to "MY CONTENT" in a document like:
1405
-
1406
-
```markdown
1407
-
# Some top-level heading
1408
-
1409
-
## Some second-level heading
1410
-
1411
-
### My Heading
1412
-
1413
-
MY CONTENT
1414
-
```
1415
-
1416
-
you should now set yoru `Target` heading to `Some top-level heading::Some second-level heading::My Heading`.
Copy file name to clipboardExpand all lines: docs/src/lib/patch.jsonnet
+2-32Lines changed: 2 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -149,6 +149,8 @@
149
149
description: |||
150
150
Allows you to modify the content relative to a heading, block reference, or frontmatter field in your document.
151
151
152
+
Note that this API was changed in Version 3.0 of this extension and the earlier PATCH API is now deprecated. Requests made using the previous version of this API will continue to work until Version 4.0 is released. See https://github.com/coddingtonbear/obsidian-local-rest-api/wiki/Changes-to-PATCH-requests-between-versions-2.0-and-3.0 for more details and migration instructions.
153
+
152
154
# Examples
153
155
154
156
All of the below examples assume you have a document that looks like
@@ -272,37 +274,5 @@
272
274
interpreting yoru `prepend` or `append` requests if you specify
273
275
your data as JSON (particularly when appending, for example,
274
276
list items).
275
-
276
-
# Upgrading from Version 2.0 (heading-based) to Version 3.0 (target-based) APIs
277
-
278
-
This API was changed in version 3.0 of Obsidian Local REST API to support making changes to your document relative to ["block references"](https://help.obsidian.md/Linking+notes+and+files/Internal+links#Link+to+a+block+in+a+note) and frontmatter fields in addition to headings within your document.
279
-
Version 2.0 of this API (now undocumented) is still accessible as
280
-
long as your incoming request specifies the `Heading` header and
281
-
*does not* specify a `Target-Type` header. You should upgrade, though,
282
-
to the current version of the API as support for the Version 2.0 API is
283
-
now deprecated and will stop working in Version 4.0.
284
-
285
-
You can migrate to the current version of the API by following the below guidelines. The words "heading" and "header" both occur quite a lot in the below paragraphs so it may aid in your understanding if you keep in mind that "head**ing**" here refers to a heading existing within your markdown document and "head**er**" refers to an HTTP Header that you may set to a value as part of using this API.
286
-
287
-
1. Rename your `Heading` header to `Target`.
288
-
2. Add a new `Target-Type` header having the value `heading`.
289
-
3. Set the `Operation` header such that its value is `append` if you had either not set the `Content-Insertion-Position` header or had set it to `end`. Set it to `prepend` if you had set `Content-Insertion-Position` to `beginning`.
290
-
4. If you had set `Content-Insertion-Ignore-Newline` to `true`, set the `Trim-Target-Whitespace` header value to `true` also.
291
-
292
-
Aside from the above, there is one important thing to keep in mind: while the obsolete version of this API allowed you to specify just the terminal heading (e.g. content under `### My Heading` could be addressed by setting the `Heading` header to `My Heading`), the current version of this API requires that you provide the full path to your target heading (i.e. instead of `My Heading`, you must find the parent second level heading and and its parent top level heading) delimited by `::`. If `::` appears in your heading, you can override that value by setting the `Target-Delimiter` header.
293
-
294
-
For example, if you had previously set `Heading` to `My Heading` for adding content to "MY CONTENT" in a document like:
295
-
296
-
```markdown
297
-
# Some top-level heading
298
-
299
-
## Some second-level heading
300
-
301
-
### My Heading
302
-
303
-
MY CONTENT
304
-
```
305
-
306
-
you should now set yoru `Target` heading to `Some top-level heading::Some second-level heading::My Heading`.
0 commit comments