Skip to main content

Module article

Module article 

Source
Expand description

An article (NIP-23) where it is shown: its card, in a list and under a note that names it, and what stands over and under what it says where it is opened.

The card is the one the preview of a link has, and as tall: the article’s picture at its left end, and beside it what it is and how long it takes to read, its title, and the first lines of what sums it up. It is as tall whatever the article says of itself, so a list knows how tall its row is before it is drawn.

Opened, an article has its title over it, large; how long it takes to read and when it was last changed; what sums it up, set apart as a quote is; and its picture, as a strip across. Under it are its topics. Between them is what it says, which a note’s row shows as it shows any note’s text (see said).

Constants§

CHAR_WIDTH_PER_SIZE 🔒
What a character of text is taken to be wide, for its size, where it has not been laid out: as a row takes it.
QUIET_ALPHA 🔒
How much quieter than the text the small print of an article is, and what sums it up.
SUMMARY_BAR_ALPHA 🔒
SUMMARY_BAR_WIDTH 🔒
The bar before what sums an opened article up, and the room between the two.
SUMMARY_GAP 🔒
TITLE_SCALE 🔒
How many times the size of a note’s text an opened article’s title is set in: as its largest heading is.

Functions§

article_card
The card of the article note is, whose tags said article. It opens the article when it is pressed, if it is pressed and no menu is open over the list; in the article’s own row it is not, and a click on it is a click on the row.
article_card_height
How tall the card of an article is in a row set in sizes: as the preview of a link is.
article_head
What stands over the opened article note is, whose tags said article: its title, how long it takes to read and when it was last changed, what sums it up, and its picture.
article_head_height
How tall what stands over an opened article will be, near enough, set in sizes in a row width wide, with the room between its parts and none around it.
article_link
An article a note names that is not at hand: the short form of its address, on a line of its own, which looks for it and opens it.
article_topics
What the opened article is about, under what it says: its topics, on one line that is cut where it ends. Nothing for one that names none.
article_topics_height
How tall the line of an article’s topics is, set in sizes.
lines 🔒
How many lines chars characters of text of size come to in room width wide, near enough.
title 🔒
What an article is called where it says nothing of that.
title_size 🔒
How large an opened article’s title is set, in a row set in sizes.