Skip to content

Markdown engine / Image rendering #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Jul 23, 2025
Merged

Markdown engine / Image rendering #12

merged 24 commits into from
Jul 23, 2025

Conversation

ploMP4
Copy link
Member

@ploMP4 ploMP4 commented Jun 5, 2025

This pull request adds image rendering along with a refactor to the markdown parsing engine.

Markdown Architecture

Parser:

  • An extensible parser architecture with multiple specialized parsers
  • Each parser uses a Trigger() method to identify the specific byte that activates its parsing logic
  • Supports parser prioritization to handle cases where multiple parsers share the same trigger byte
  • Implements graceful fallback: parsers return nil on failure, allowing the system to try the next parser in priority order
  • Creates GlamourNode instances when no specialized parser can handle the content

Renderer:

The Renderer consumes the nodes generated by the parser and generates the proper output

Loading
graph TB
    subgraph "Markdown Package Architecture"
        A[Input Markdown Text] --> B[MarkdownParser]
        
        subgraph "Parser Registry"
            C[Parser A<br/>Priority: 1]
            D[Parser B<br/>Priority: 2]
            E[Parser N<br/>Priority: N]
        end
        
        B --> F[Trigger-Based Parser Selection]
        C --> F
        D --> F
        E --> F
        
        subgraph "Node Types"
            G[Custom Node A]
            H[Custom Node B]
            I[GlamourNode<br/>Fallback]
        end
        
        F --> G
        F --> H
        F --> I
        
        subgraph "Renderer Components"
            J[Main Renderer]
            K[Default Renderer For GlamourNode]
            L[Custom Renderer For Node A]
            M[Custom Renderer For Node B]
        end
        
        G --> J
        H --> J
        I --> J
        
        J --> K
        J --> L
        J --> M
        
        N[Styled Terminal Output] 
        K --> N
        L --> N
        M --> N
    end

@ploMP4 ploMP4 added enhancement New feature or request help wanted Extra attention is needed labels Jun 5, 2025
@tharropoulos
Copy link
Member

Please add an example presentation so we have a common ground for what we are rendering

@ploMP4 ploMP4 force-pushed the image-rendering branch from 7ce09f3 to 96784ca Compare June 22, 2025 13:29
ploMP4 added 2 commits June 22, 2025 16:30

Verified

This commit was signed with the committer’s verified signature.
tharropoulos Fanis Tharropoulos

Verified

This commit was signed with the committer’s verified signature.
tharropoulos Fanis Tharropoulos
@ploMP4 ploMP4 force-pushed the image-rendering branch 2 times, most recently from c6a420a to e03261b Compare June 23, 2025 22:18
@ploMP4 ploMP4 removed the help wanted Extra attention is needed label Jul 18, 2025
@ploMP4 ploMP4 self-assigned this Jul 18, 2025
@ploMP4 ploMP4 changed the title Image rendering Markdown engine / Image rendering Jul 19, 2025
ploMP4 added 13 commits July 19, 2025 03:19

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos
wip: logging
wip: remove preRender frame and add demo cache
wip: successfull image rendering

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos
- Extendable parser that returns nodes that a renderer can consume
- Node types for available features (Images, CodeBlocks) and default
Glamour node

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos
@ploMP4 ploMP4 force-pushed the image-rendering branch from 42133a1 to 2310f3c Compare July 19, 2025 00:20
ploMP4 added 4 commits July 19, 2025 17:40

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos
…ry + doc strings

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos
ploMP4 added 4 commits July 19, 2025 20:25

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos
…ad of int32

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos
@ploMP4 ploMP4 force-pushed the image-rendering branch from 76ba59d to ffa6439 Compare July 20, 2025 16:01
@ploMP4 ploMP4 marked this pull request as ready for review July 20, 2025 16:14
@ploMP4 ploMP4 requested a review from tharropoulos July 20, 2025 16:14

Verified

This commit was signed with the committer’s verified signature.
ploMP4 Konstantinos Artopoulos
…al does not support it
Copy link
Member

@tharropoulos tharropoulos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny little changes 😅

:shipit:

@ploMP4 ploMP4 merged commit 2c3e53b into main Jul 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants