guardian / scribe-plugin-noting

9 stars 3 forks source link

Ambiguity between "note" and "noteSegment" #42

Closed robinedman closed 9 years ago

robinedman commented 9 years ago

For clarity and consistency I suggest that note === [noteSegment, ...]. A "note" should always be an array of one or more note segments. A note segment is a a vFocus on a <gu-note> tag.

At the moment there's some ambiguity around this. findFirstNote for example checks whether a vFocus is a note segment (would be better named as findFirstNoteSegment). findAllNotes get is right: it returns an array of notes (where each note is an array of note segments).

I went through the utility functions and checked whether they're correct in this sense or should be renamed: findAllNotes - correct findEntireNote - correct findFirstNote -> findFirstNoteSegment findLastNote -> findLastNoteSegment findNoteById - correct findParentNote -> findParentNoteSegment findSelectedNote - correct isNotWithinNote - correct isNote -> isNoteSegment isWithinNote - correct

cutandpastey commented 9 years ago

Fixed with https://github.com/guardian/scribe-plugin-noting/pull/58