View Source Naiveical.Creator.Vcard (Naiveical v0.1.8)

Module for creating Vcard(vcf) text files.

Link to this section Summary

Functions

Creates address property. Address property has 7 list-components, where first two are ommited. Please refer to RFC 6350 Section 6.3.1

Creates catagories, also know as tags. Categories are comma separated like CSV. Can be used to group vcards. Reference RFC 6350 Section 6.7.1

Creates an email to put in VCARD file. Pass a keyword list of params(options) to add params to email address you are creating. Please refer the RFC 6350 Section 6.4.2 for more details about the supported params.

Creates a full name for VCARD. N property consist of 5 list-components. N:PREFIX;FIRSTNAME;MIDDLENAME;LASTNAME;SUFFIX ReferenceRFC Idenitification Properties N SECTION 6.2.2

Creates a KIND for vcard. Please refer to RFC Section 6.1.4

Creates NICKNAME, can be random text.

Simple note to add more information about the VCARD. Reference RFC 6350 Section 6.7.2

Creates organization.

Creates ROLE, it is most often associated with organization.

Creates special dates such as birthdays or anniversary.

Creates telephone property for VCARD. Reference RFC Section 6.4.1

Creates TITLE, it is most often associated with organization.

Create a simple VCard file. VERSION and FN property must be included in vcard object. NOTE: in our case, which we are using SabreDav as a Cardav server, version and product ID will be overwritten by server itself.

Link to this section Functions

Link to this function

create_address(address, opts \\ [])

View Source
@spec create_address(address :: String.t(), opts :: List.t()) :: String.t()

Creates address property. Address property has 7 list-components, where first two are ommited. Please refer to RFC 6350 Section 6.3.1

Link to this function

create_categories(categories, opts \\ [])

View Source
@spec create_categories(categories :: String.t(), opts :: List.t()) :: String.t()

Creates catagories, also know as tags. Categories are comma separated like CSV. Can be used to group vcards. Reference RFC 6350 Section 6.7.1

Link to this function

create_display_name(display_name \\ "", first_name \\ "", last_name \\ "")

View Source

Creates display name, which is FN property defined by RFC 6350 Section 6.2.1

example

Example

iex> Naiveical.Creator.Vcard.create_display_name("Display Name")
"Display Name"
Link to this function

create_email(address, opts \\ [])

View Source
@spec create_email(address :: String.t(), opts :: List.t()) :: String.t()

Creates an email to put in VCARD file. Pass a keyword list of params(options) to add params to email address you are creating. Please refer the RFC 6350 Section 6.4.2 for more details about the supported params.

example

Example

iex> Naiveical.Creator.Vcard.create_email("email@domain.tld", type: "work", pref: 1, label: "good")
EMAIL;TYPE=work;PREF=1;LABEL=good:email@domain.tld
Link to this function

create_full_name(prefix, first_name, middle_name, last_name, suffix, opts \\ [])

View Source
@spec create_full_name(
  prefix :: String.t(),
  first_name :: String.t(),
  middle_name :: String.t(),
  last_name :: String.t(),
  suffix :: String.t(),
  opts :: List.t()
) :: String.t()

Creates a full name for VCARD. N property consist of 5 list-components. N:PREFIX;FIRSTNAME;MIDDLENAME;LASTNAME;SUFFIX ReferenceRFC Idenitification Properties N SECTION 6.2.2

example

Example

iex> Naiveical.Creator.Vcard.create_full_name("", "User", "Middle", "Surname", "", value: "text")
N;VALUE=text:;User;Middle;Surname;;
Link to this function

create_kind(kind, opts \\ [])

View Source
@spec create_kind(nickname :: String.t(), opts :: List.t()) :: String.t()

Creates a KIND for vcard. Please refer to RFC Section 6.1.4

Link to this function

create_nickname(nickname, opts \\ [])

View Source
@spec create_nickname(nickname :: String.t(), opts :: List.t()) :: String.t()

Creates NICKNAME, can be random text.

Link to this function

create_note(note, opts \\ [])

View Source

Simple note to add more information about the VCARD. Reference RFC 6350 Section 6.7.2

Link to this function

create_organization(org, opts \\ [])

View Source
@spec create_organization(nickname :: String.t(), opts :: List.t()) :: String.t()

Creates organization.

Link to this function

create_role(role, opts \\ [])

View Source
@spec create_role(nickname :: String.t(), opts :: List.t()) :: String.t()

Creates ROLE, it is most often associated with organization.

Link to this function

create_special_date(date, type, opts \\ [])

View Source

Creates special dates such as birthdays or anniversary.

Link to this function

create_telephone(tel, opts \\ [])

View Source
@spec create_telephone(tel :: String.t(), opts :: List.t()) :: String.t()

Creates telephone property for VCARD. Reference RFC Section 6.4.1

example

Example

iex> Naiveical.Creator.Vcard.create_telephone("1234567890", type: "work", pref: 1)
TEL;TYPE=work;PREF=1:1234567890
Link to this function

create_title(title, opts \\ [])

View Source
@spec create_title(nickname :: String.t(), opts :: List.t()) :: String.t()

Creates TITLE, it is most often associated with organization.

Link to this function

create_vcard(uuid, opts \\ [])

View Source

Create a simple VCard file. VERSION and FN property must be included in vcard object. NOTE: in our case, which we are using SabreDav as a Cardav server, version and product ID will be overwritten by server itself.

Link to this function

create_website(url, opts \\ [])

View Source
@spec create_website(url :: String.t(), opts :: List.t()) :: String.t()

Creates URL property. Reference RFC 6350 Section 6.7.8

example

Example

iex> Naiveical.Creator.Vcard.create_website("https://example.org", type: "work")
URL;TYPE=work:https://example.org