Skip to content

Conversation

@KyleKing
Copy link
Owner

  • Add obsidian_plugin export that combines all plugins (callouts, footnotes, task lists, dollar math) for easy HTML rendering
  • Update README with correct HTML rendering example showing proper output
  • Replace TODO/FIXME comments with explanatory NOTE comments explaining technical limitations
  • Document blockquote wrapper limitation and suggest post-processing for accessibility
  • All tests passing (20/20)

Changes:

  • mdformat_obsidian/mdit_plugins/init.py: Added obsidian_plugin() function
  • README.md: Updated HTML rendering section with correct output example
  • _obsidian_callouts.py: Clarified blockquote replacement limitation
  • _obsidian_inline_footnotes.py: Updated TODO to NOTE about implemented rendering
  • plugin.py: Clarified content div rendering approach

claude and others added 8 commits November 21, 2025 04:56
- Add obsidian_plugin export that combines all plugins (callouts, footnotes, task lists, dollar math) for easy HTML rendering
- Update README with correct HTML rendering example showing proper output
- Replace TODO/FIXME comments with explanatory NOTE comments explaining technical limitations
- Document blockquote wrapper limitation and suggest post-processing for accessibility
- All tests passing (20/20)

Changes:
- mdformat_obsidian/mdit_plugins/__init__.py: Added obsidian_plugin() function
- README.md: Updated HTML rendering section with correct output example
- _obsidian_callouts.py: Clarified blockquote replacement limitation
- _obsidian_inline_footnotes.py: Updated TODO to NOTE about implemented rendering
- plugin.py: Clarified content div rendering approach
- Register HTML renderer rules for all callout token types
- Use md.add_render_rule() to properly bind renderer functions
- Smart newline handling: omit newlines before inline content and closing tags
- Prevents extra whitespace in rendered HTML output

This properly implements HTML rendering that was previously relying on
default markdown-it behavior. All 20 tests passing including:
- Callout rendering with proper div structure and attributes
- Foldable callouts with collapse state
- Nested callouts
- Inline footnotes
- Task lists
- Dollar math

The renderer checks next token type to intelligently add/omit newlines,
ensuring clean HTML output that matches expected formatting.
- Add TYPE_CHECKING imports for RendererHTML, Token, OptionsDict, EnvType
- Add complete type annotations to render_callout_open and render_callout_close
- Prefix unused parameters with underscore (_options, _env, _self)
- Fix import order: move Callable from typing to collections.abc
- Auto-format code with ruff

All ruff checks now pass:
- ANN202: Function return types added
- ANN001: All parameter types annotated
- ARG001: Unused parameters prefixed with underscore
- UP035: Callable imported from collections.abc

Tests: All 20 tests passing
@KyleKing KyleKing marked this pull request as ready for review November 22, 2025 05:00
@KyleKing KyleKing merged commit 47e3b3d into main Nov 22, 2025
7 checks passed
@KyleKing KyleKing deleted the claude/implement-html-renders-01GRGgpEbtLuHdbNMHUkJj3H branch November 22, 2025 05:04
@KyleKing KyleKing restored the claude/implement-html-renders-01GRGgpEbtLuHdbNMHUkJj3H branch November 23, 2025 05:59
@KyleKing KyleKing deleted the claude/implement-html-renders-01GRGgpEbtLuHdbNMHUkJj3H branch November 24, 2025 02: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.

3 participants