Skip to content

Add Fable.Literate test infrastructure and fix boilerplate filtering - #6

Merged
dbrattli merged 1 commit into
mainfrom
add-fable-literate-tests
Dec 21, 2025
Merged

Add Fable.Literate test infrastructure and fix boilerplate filtering#6
dbrattli merged 1 commit into
mainfrom
add-fable-literate-tests

Conversation

@dbrattli

Copy link
Copy Markdown
Contributor

Summary

  • Add test project with dual .NET/Python support using Expecto and Fable.Pyxpecto
  • Fix boilerplate filtering to keep modules with bodies (module Foo = ...) while still filtering standalone declarations
  • Add trimCode utility to preserve indentation while removing leading empty lines
  • Add test commands to justfile: test, build-tests, test-python, test-all
  • Regenerate docs with improved code visibility

Details

The isBoilerplate function was too aggressive - it filtered out ALL code blocks starting with module or namespace , including modules with bodies like module Foo = let x = 1. Now it only filters standalone declarations (no = sign), keeping module definitions with bodies visible in the output.

The test suite includes 18 tests covering:

  • Parser (markdown blocks, code blocks, directives)
  • Transform (filterHidden, filterBoilerplate)
  • Utils (trimCode indentation handling)
  • MarkdownPrinter (code block rendering)
  • Pipeline (full document processing)

Test plan

  • Run just test - 18 tests pass on .NET
  • Run just test-python - 18 tests pass on Python
  • Verify just generate produces correct markdown output

🤖 Generated with Claude Code

…ering

- Add test project with Expecto (.NET) and Fable.Pyxpecto (Python) support
- Fix isBoilerplate to keep modules with bodies (module Foo = ...)
- Add trimCode utility to preserve indentation while removing empty lines
- Add test commands to justfile (test, build-tests, test-python, test-all)
- Regenerate docs with improved code visibility

The boilerplate filter was too aggressive, removing all module declarations
including those with bodies. Now it only filters standalone declarations
(module Foo, namespace Bar) while keeping module definitions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dbrattli
dbrattli merged commit 24471e7 into main Dec 21, 2025
1 check passed
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.

1 participant