mirror of
https://github.com/jalad25/contact-note.git
synced 2026-07-22 06:53:06 +00:00
Updated README and DEVELOPMENT with new info on birthday builtin property.
This commit is contained in:
parent
00a158215f
commit
6bd2acffd2
2 changed files with 5 additions and 1 deletions
|
|
@ -121,6 +121,8 @@ The plugin splits contact-note concerns across two files:
|
|||
- **[`ContactNote.ts`](src/ContactNote.ts)** — the on-disk schema and the `ContactNote` class. Holds the canonical list of built-in fields (their kinds, origins, and default icons) and exposes `getFields()`, `getField(key)`, `getReadKey(field)`, `getIcon(field)`, `applyCustomizations(...)`, and `buildContactNote(firstName, lastName, tag?)`. A single instance lives on the plugin as `plugin.contactNote`. Anything that needs to know *what a contact note looks like on disk*, or *what frontmatter key/icon to use for a built-in field*, should ask this instance.
|
||||
- **[`Contact.ts`](src/Contact.ts)** — the runtime model. `Contact.fromCache(file, frontmatter, frontmatterLinks, contactNote)` walks the field list, reads each value through `contactNote.getReadKey(field)`, and exposes typed fields (`firstName`, `emails`, `socials`, etc.) plus `isValid` and `getFieldLink(readKey)` for fields the user wrote as `[[Target]]` in frontmatter. The card renderer, panel view, and bases view all consume `Contact` instances rather than raw frontmatter.
|
||||
|
||||
Frontmatter values that come through YAML as `Date` objects (e.g., bare ISO dates like `1990-04-15`) are coerced to `YYYY-MM-DD` strings by `trimStr` in `Contact.ts`. All scalar fields end up as strings regardless of source type. There is no `Date` kind, and downstream code can assume `string` everywhere.
|
||||
|
||||
Adding or removing a built-in frontmatter field starts in `BUILTIN_FIELD_DEFS` (in `ContactNote.ts`). The `Contact.update()` loop, `ContactNote.buildContactNote()`, the bases view's per-entry read loop, and the settings-tab customization grid all iterate `contactNote.getFields()`.
|
||||
|
||||
## Frontmatter Customization
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ All fields are optional except `firstName` and `lastName`.
|
|||
| `title` | text or `[[wikilink]]` | Job title or role. If set to an internal link, the contact card renders it as a clickable link. See [Internal Links](#internal-links). |
|
||||
| `company` | text or `[[wikilink]]` | Company or organization name. If set to an internal link, the contact card renders it as a clickable link. See [Internal Links](#internal-links). |
|
||||
| `department` | text or `[[wikilink]]` | Department, team, or division within the company. If set to an internal link, the contact card renders it as a clickable link. See [Internal Links](#internal-links). |
|
||||
| `birthday` | text | Birthday. Any format works (e.g. `1990-04-15`, `April 15`, `4/15`). Only displayed on the contact card in reading mode, not in the panel or base views. |
|
||||
| `emails` | text or list | One or more email addresses. |
|
||||
| `phoneNumbers` | text or list | One or more phone numbers. |
|
||||
| `photo` | text | Vault path to a photo file (e.g. `Attachments/jane.jpg`). |
|
||||
|
|
@ -136,6 +137,7 @@ emails:
|
|||
- geordi@notarealemail.com
|
||||
phoneNumbers:
|
||||
- 123-456-7890
|
||||
birthday: 2013-05-23
|
||||
photo: Attachments/Geordi.jpg
|
||||
aliases:
|
||||
- Geordi
|
||||
|
|
@ -181,7 +183,7 @@ Platforms not in this list will still display the handle as plain text without a
|
|||
|
||||

|
||||
|
||||
In reading mode, any contact note with a valid `firstName` and `lastName` frontmatter renders a contact card in place of the frontmatter block. The card displays the contact's photo, name, title, company, department, email addresses, phone numbers, and social media profiles.
|
||||
In reading mode, any contact note with a valid `firstName` and `lastName` frontmatter renders a contact card in place of the frontmatter block. The card displays the contact's photo, name, title, company, department, birthday, email addresses, phone numbers, and social media profiles.
|
||||
|
||||
### Display Name Resolution
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue