nohead 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/nohead/operations.rb +3 -3
- data/lib/nohead/resources/records.rb +5 -3
- data/lib/nohead/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c6b193ea9901727584990d4821f6cd66a49f4f38caff164c526c04aee8176a47
|
|
4
|
+
data.tar.gz: 273d03d8a27dbe0ca5003d4a7a69ee3bc174f8b2541ff444acc0a2d01b816d5f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5d947a9c0bec4a387a5242d48e90e56a8cbd717103d633ba6fb4599d3371592198b7d6dcece96f7e839e6d69191c8480e11eed0ec91a333ffa9c86b25ce5578e
|
|
7
|
+
data.tar.gz: f520e1f670adfdef79286d59becb7a5625ac5e73a105a501878e33b02e99448464b579097e68d7c489fe8775030c931299ac826f80e385619f799e7b4286d13e
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ Changes to the `nohead` gem that you can notice. Versions follow
|
|
|
5
5
|
releases; a change that could break your code is a major one. Each release's
|
|
6
6
|
section is its GitHub release's notes.
|
|
7
7
|
|
|
8
|
+
## 0.11.0
|
|
9
|
+
|
|
10
|
+
- `records.diff` takes `rich_text:`, and the client's `rich_text:` now applies
|
|
11
|
+
to it: a rich text field's `before` and `after` read as HTML or Markdown
|
|
12
|
+
instead of documents. A revert preview's `changes` follow `rich_text:` too.
|
|
13
|
+
|
|
8
14
|
## 0.10.0
|
|
9
15
|
|
|
10
16
|
- Rich text fields read as HTML or Markdown with `rich_text:` (`"document"`,
|
data/README.md
CHANGED
|
@@ -128,7 +128,7 @@ nohead.records.get(id, rich_text: "markdown").data["body"] # a Markdown string
|
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
- With `"html"` or `"markdown"`, the field's value is a string instead of the document, in records embedded with `expand:` too. `"document"` is the default.
|
|
131
|
-
- The methods that return records or drafts take `rich_text
|
|
131
|
+
- The methods that return records or drafts take `rich_text:`, and so does `records.diff`, for its changes' `before` and `after` (a revert preview's `changes` follow it too); a call's value wins over the client's, and other methods never send it.
|
|
132
132
|
- HTML has every text and attribute escaped, ready to put in a page. Images come with their URLs, so they need no `expand:`.
|
|
133
133
|
- Record history (`records.revisions.list` and `get`) and webhook events keep documents.
|
|
134
134
|
- A string you write is read as Markdown, so write back Markdown or the document, never the HTML: with `rich_text: "html"` on the client, writes answer with HTML too.
|
data/lib/nohead/operations.rb
CHANGED
|
@@ -104,8 +104,8 @@ module Nohead
|
|
|
104
104
|
collections_search drafts_create drafts_discard drafts_get
|
|
105
105
|
drafts_list drafts_merge drafts_schedule drafts_unschedule
|
|
106
106
|
drafts_update projects_search record_drafts_list record_revisions_revert
|
|
107
|
-
records_bulk records_create records_delete
|
|
108
|
-
records_list records_publish records_restore
|
|
109
|
-
records_update
|
|
107
|
+
records_bulk records_create records_delete records_diff
|
|
108
|
+
records_get records_list records_publish records_restore
|
|
109
|
+
records_unpublish records_update
|
|
110
110
|
].to_set.freeze
|
|
111
111
|
end
|
|
@@ -162,9 +162,11 @@ module Nohead
|
|
|
162
162
|
rich_text: rich_text)
|
|
163
163
|
end
|
|
164
164
|
|
|
165
|
-
# The changes between two revisions: diff(record, from: 1, to: 2).
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
# The changes between two revisions: diff(record, from: 1, to: 2). With
|
|
166
|
+
# rich_text:, rich text fields' before and after read as HTML or Markdown.
|
|
167
|
+
def diff(record, from:, to:, rich_text: nil)
|
|
168
|
+
@client.request("records_diff", path: { record_id: record }, query: { from: from, to: to },
|
|
169
|
+
rich_text: rich_text)
|
|
168
170
|
end
|
|
169
171
|
|
|
170
172
|
# Full-text search in one collection, matching its searchable fields, most
|
data/lib/nohead/version.rb
CHANGED