Skip to content

Conversation

@dereuromark
Copy link
Contributor

Summary

Adds a command-line tool for converting djot files to HTML.

Usage

# Convert file to stdout
vendor/bin/djot document.djot

# Convert file to output file
vendor/bin/djot document.djot -o document.html

# Convert from stdin
echo '*hello*' | vendor/bin/djot

# With options
vendor/bin/djot document.djot --xhtml --safe --warnings

Options

Option Description
-o, --output FILE Write output to FILE instead of stdout
-x, --xhtml Use XHTML-compatible output (self-closing tags)
-s, --safe Enable safe mode (sanitize dangerous HTML)
-w, --warnings Show parse warnings on stderr
--strict Exit with error code 1 if warnings are generated
-h, --help Show help message
-v, --version Show version information

Test plan

  • Tests pass
  • Code style passes
  • Manual testing of all options

- Add bin/djot script for converting djot files to HTML
- Support file input or stdin
- Options: --output, --xhtml, --safe, --warnings, --strict
- Register bin in composer.json
@codecov
Copy link

codecov bot commented Dec 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.72%. Comparing base (2946eb7) to head (f1e94d3).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #54   +/-   ##
=========================================
  Coverage     93.72%   93.72%           
  Complexity     1928     1928           
=========================================
  Files            74       74           
  Lines          5177     5177           
=========================================
  Hits           4852     4852           
  Misses          325      325           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dereuromark dereuromark marked this pull request as ready for review December 15, 2025 08:20
@dereuromark dereuromark merged commit afec875 into master Dec 15, 2025
6 checks passed
@dereuromark dereuromark deleted the feature/cli-tool branch December 15, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants