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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 614f02b14cf5307614caf01ae06d458d770bff423c34d567d0fe8f7924467298
4
- data.tar.gz: 052d1089ecc31f984b4d1e143638b4b26b8d393c1a8eac9764a5e6df8a76d364
3
+ metadata.gz: c6b193ea9901727584990d4821f6cd66a49f4f38caff164c526c04aee8176a47
4
+ data.tar.gz: 273d03d8a27dbe0ca5003d4a7a69ee3bc174f8b2541ff444acc0a2d01b816d5f
5
5
  SHA512:
6
- metadata.gz: 432a87faa068fb1719a38ba559520de892c0cf48abc0783b1ba1c0114d6fbe252b5cffd72c0d89d40de323c563e7c528334796ff7da0695ff2b48b2636fa46da
7
- data.tar.gz: 1383b012a30ec74972234dcda1c61f62f75e948929c9f8c6d14e52fcd7245595521c2e00426b0e0030a4b3887dc77231c2808ec5ef0390aa8818b8f655216c2e
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:`; a call's value wins over the client's, and other methods never send it.
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.
@@ -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 records_get
108
- records_list records_publish records_restore records_unpublish
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
- def diff(record, from:, to:)
167
- @client.request("records_diff", path: { record_id: record }, query: { from: from, to: to })
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nohead
4
- VERSION = "0.10.0"
4
+ VERSION = "0.11.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nohead
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nohead