Skip to content

Add warnings#213

Open
panglesd wants to merge 42 commits intomainfrom
warnings-report
Open

Add warnings#213
panglesd wants to merge 42 commits intomainfrom
warnings-report

Conversation

@panglesd
Copy link
Owner

@panglesd panglesd commented Feb 25, 2026

Add warnings for many problems:

  • Parsing problems in actions
  • Unknown attributes (neither HTML standard, nor slipshow-specific)
  • ID that link nowhere
  • ID given multiple times
  • ID that point to the wrong type of block (eg exec on something that is not a slip-script)
  • Frontmatter parsing failures
  • Missing files

Fix #81 #82 #84 #110 which completes #80.

This requires good locations, so I made a few fixes in the vendored cmarkit.

The reporting rendering is done using grace:

$ slipshow compile slip.md
warning[FSError]: file 'img.png' could not be read: img.png: No such file or directory
    ┌─ slip.md:3:25
  3 │  A missing file: ![image](img.png)
    │                          ^^^^^^^^^ 

warning[DupID]: ID id1 is assigned multiple times
    ┌─ slip.md:10:9
  7 │  Hello1{#id1}
    │          ^^^ 
  8 │  Hello2{#id1}
    │          ^^^ 
  9 │  
 10 │  Hello3{#id1}
    │          ^^^ 

It remains to make those warnings nicely visible in serve mode, and to add comprehensive tests.

Due to the javascript API, this requires both an `args` type that is pure OCaml,
and a `js_args` type which contains JS stuff
- Make engine not depend on camrkit/grace
- Extract checks in its module and make progress on them
- Parsing output locations too
- Add empty line between diagnostics
- Probably other small things
Fix locations of block quotes to include the first marker
This commit does not include the code to show them well
- Add ansi to turn ansi output into HTML output
- Add external-ids to frontmatter to treat some ids as externally-provided
- Add an error element to receive warnings in serve mode
- Fix frontmatter extraction in convert_to_md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant