Fix broken documentation for output method target parameter#770
Merged
Fix broken documentation for output method target parameter#770
Conversation
Co-authored-by: lucemia <432851+lucemia@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (78.74%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #770 +/- ##
==========================================
+ Coverage 78.74% 81.24% +2.49%
==========================================
Files 51 78 +27
Lines 3331 4553 +1222
==========================================
+ Hits 2623 3699 +1076
- Misses 708 854 +146
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Co-authored-by: lucemia <432851+lucemia@users.noreply.github.com>
Co-authored-by: lucemia <432851+lucemia@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix damaged documentation for output method
Fix broken documentation for output method target parameter
Oct 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The documentation for the
outputmethod'stargetparameter was displaying with broken formatting on the generated documentation site. The parameter description was split across multiple lines with malformed text:This made the documentation difficult to read and appeared as damaged text in both the Python docstrings and the rendered HTML documentation at https://livingbio.github.io/typed-ffmpeg/reference/ffmpeg/#ffmpeg.VideoStream.output.
Root Cause
The issue originated from the source data file (
src/ffmpeg/common/cache/list/options.json) which contained a literal\n(backslash-n) character embedded in the help text. This represented a C-style string continuation from the original FFmpeg source code that was not being properly handled during code generation.Solution
This PR implements a comprehensive fix with two components:
1. Immediate Fix
src/ffmpeg/dag/io/output_args.py2. Future-Proof Fix
Added a
normalize_help_textJinja2 filter to the code generation system (src/scripts/code_gen/gen.py) that:\nsequences followed by whitespace and quotes with single spacesUpdated the code generation templates (
src/scripts/code_gen/templates/dag/io/_output.py.jinjaandoutput_args.py.jinja) to apply this filter to all help text during generation.Result
The documentation now correctly displays as:
Testing
mkdocs build --strictsuccessfullyThis fix ensures that both the current documentation and any future code generation will properly handle help text containing line breaks or C-style string continuations.
Original prompt
Fixes #769
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.