Module Arod_component.Links

Links page component.

Shows all outbound external links ordered by date (newest first), with enriched display: GitHub shortnames, arxiv IDs, contact associations, karakeep titles, and favicons. Paginated via infinite scrolling.

module Entry = Bushel.Entry
module Contact = Sortal_schema.Contact
module I = Arod.Icons

Helpers

val domain_and_path : string -> string * string

Format a URL as "domain /path" with truncated path.

URL Classification

val string_of_kind : link_kind -> string
val path_segments : string -> string list

Extract path segments from a URL.

val extract_rfc_number : string -> string option

Try to extract an RFC number from a URL path.

val shared_platforms : string list

Shared platforms that should not be contact-matched.

val strip_www : String.t -> String.t
val build_contact_by_domain : Contact.t list -> (string, (string * Contact.t) list) Hashtbl.t

Build a domain-to-contact hashtable with path prefixes. Each domain maps to a list of (path_prefix, contact) pairs so that e.g. cl.cam.ac.uk/~sv440/ does not match cl.cam.ac.uk/~avsm2/.

val find_contact_for_url : ('a, (String.t * 'b) list) Hashtbl.t -> 'a -> String.t -> 'b option

Find a contact for a URL by matching domain and longest path prefix.

val classify_url : contact_by_domain:(String.t, (String.t * Contact.t) list) Hashtbl.t -> doi_entries:Bushel.Doi_entry.t list -> ctx:Arod.Ctx.t -> string -> link_display

Classify a URL into a structured display.

val code_hosts : string list

Code hosting platforms for filter classification.

type filter_kind =
  1. | Fp_paper
  2. | Fp_contact
  3. | Fp_code
  4. | Fp_titled
  5. | Fp_untitled

Filter categories for the sidebar infobox.

val string_of_filter_kind : filter_kind -> string
val filter_of_kind : link_kind -> filter_kind

Map fine-grained display kind to filter category.

Kind Badge

val kind_badge : entries:Entry.t -> link_display -> Htmlit.El.html

Group Computation

val compute_groups : ctx:Arod.Ctx.t -> link_group list

Compute all link groups sorted by entry date descending.

Group Rendering

val render_group : contact_by_domain:(String.t, (String.t * Contact.t) list) Hashtbl.t -> doi_entries:Bushel.Doi_entry.t list -> entries:Entry.t -> ctx:Arod.Ctx.t -> link_group -> Htmlit.El.html

Render a single link group with a data-month-id for scroll tracking.

val render_groups_html : ctx:Arod.Ctx.t -> link_group list -> string

Render a slice of link groups as an HTML string for the pagination API.

val all_groups : ctx:Arod.Ctx.t -> link_group list

Return all computed groups for use by the pagination API.

val page_size : int