Skip to content

Blocks

INTELMO divides an article into a group of blocks. Developers can perform operations on these blocks and then return a new group of blocks.

What is a block?

A block could be a paragraph, a sentence or a word. It is a basic unit of an article. When INTELMO fetches an article from RSS feeds, it will divide the article into a group of blocks, each of which is a paragraph by default. A block has the following fields:

  • level: The level of the block, which could be paragraph, sentence or word. The rendering of a paragraph includes inter-paragraph spacing. INTELMO also provides a global level, which is shown on the top of the reader.

  • type: Different types of blocks have different styles. For example, a block with type bold will be rendered in bold.

  • content: the content of the block, which is a string.

  • children: a list of blocks. If a block has children, it will be rendered as a container. Otherwise, it will be rendered as a leaf. Details are shown in the Nesting blocks section.

python
Block(
    level="paragraph",
    type="bold",
    content="Some paragraph content",
    children=[]
)

Nesting blocks

As shown above, each block has a children field, which is a list of blocks or set to empty by default. Developers can nest blocks by setting the children field. When INTELMO recieves a block with children, it will render the children blocks inside the block itself. Otherwise, it will render the parent block with it's own content and style.

python
Block(
    level="paragraph",
    type="bold", # type omitted when children is not empty
    content="", # content omitted when children is not empty
    children=[
        Block(
            level="sentence",
            type="italic",
            content="Here is one sentence.",
            children=[] # children can be empty
        ),

        Block(
            level="sentence",
            type="italic", # type omitted when children is not empty
            content="", # content omitted when children is not empty
            children=[
                Block(
                    level="word",
                    type="underline",
                    content="happy",
                    children=[]
                ),
                Block(
                    level="word",
                    type="normal",
                    content="dog.",
                    children=[]
                )
            ]
        )
    ]
)
Here is one sentence. happy dog.

Available Configurations

Block Level

The level field of a block can be set to paragraph, sentence, word or global.

In a groundbreaking discovery, scientists aboard the research vessel "Aquatica"word have reportedly uncovered a new species of bioluminescent jellyfish in the uncharted depths of the Mariana Trench. The newly dubbed "Luminaris abyssus" emits an ethereal blue and green glow, illuminating its surroundings in a mesmerizing dance of light. sentence

Block Type

TypeExample
"normal"
The quick brown fox jumps over the lazy dog.
"bold"
The quick brown fox jumps over the lazy dog.
"italic"
The quick brown fox jumps over the lazy dog.
"underline"
The quick brown fox jumps over the lazy dog.
"light"
The quick brown fox jumps over the lazy dog.
"title"
The quick brown fox jumps over the lazy dog
"quote"
The quick brown fox jumps over the lazy dog.