[Repo Assist] Add dotnet fsdocs convert command for single-file conversion#1019
Open
github-actions[bot] wants to merge 15 commits intomainfrom
Open
[Repo Assist] Add dotnet fsdocs convert command for single-file conversion#1019github-actions[bot] wants to merge 15 commits intomainfrom
dotnet fsdocs convert command for single-file conversion#1019github-actions[bot] wants to merge 15 commits intomainfrom
Conversation
Implement a new 'convert' verb for the fsdocs CLI tool that converts a single .md, .fsx, or .ipynb file to HTML (or other formats) without building a full documentation site. - Add Literate.ConvertPynbFile public API (parallel to ConvertMarkdownFile and ConvertScriptFile) - Add ConvertCommand CLI verb with --input, --output, --template, --outputformat, --eval, --linenumbers, --parameters options - Register ConvertCommand in Program.fs entry point - Update RELEASE_NOTES.md Usage: dotnet fsdocs convert --input notebook.ipynb dotnet fsdocs convert --input file.fsx --output file.html dotnet fsdocs convert --input doc.md --outputformat markdown Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nojaf
reviewed
Feb 25, 2026
| abstract port_option: int | ||
| default x.port_option = 0 | ||
|
|
||
| [<Verb("convert", |
Collaborator
There was a problem hiding this comment.
/repo-assist it might be time to split these commands up to multiple files.
Contributor
There was a problem hiding this comment.
Yup these "/repo-assist" in PR comments still not working
9 tasks
Contributor
|
/repo-assist Add comprehensive unit tests for all new code and integration tests for all new features |
- Unit tests for Literate.ConvertPynbFile: HTML without/with template, Markdown output, FSX output - Integration tests for ConvertCommand.Execute: .md, .fsx, .ipynb conversion, markdown output format, error codes for missing file and unsupported extension Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Commit pushed:
|
This comment has been minimized.
This comment has been minimized.
dsyme
approved these changes
Feb 25, 2026
Contributor
|
/repo-assist I tried this out and it worked OK. However note how pandoc has this: where fsdocs convert has the longer I'd like to see more like where
Also I'd like to see the "Integration tests for ConvertCommand" moved to a set of tests for |
- Make input file positional (Value(0)) instead of --input flag - Add -o shorthand for --output - Infer output format from output file extension when --outputformat not specified - Move ConvertCommand integration tests to new fsdocs-tool.Tests project - Add new test for format inference from extension - Add fsdocs-tool.Tests to solution Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
dsyme
approved these changes
Feb 25, 2026
Collaborator
|
Hi @nhirschey, would you mind giving this a spin? |
This comment was marked as resolved.
This comment was marked as resolved.
…d releases A blank line within a subsection (e.g. ### Added) causes Ionide.KeepAChangelog 0.1.8 to stop parsing the file, resulting in an empty Releases list. The previous List.head call gave a cryptic 'The input list was empty' error. This replaces it with a pattern match and an actionable error message. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This was referenced Feb 27, 2026
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Closes #811
Summary
This adds a new
convertverb to thefsdocsCLI tool, enabling conversion of a single.md,.fsx, or.ipynbfile to HTML (or another output format) without needing to build a full documentation site.Usage examples:
Changes
src/FSharp.Formatting.Literate/Literate.fs: AddedLiterate.ConvertPynbFilepublic API method (parallel to the existingConvertMarkdownFileandConvertScriptFile)src/fsdocs-tool/BuildCommand.fs: AddedConvertCommandclass with[(Verb("convert"))]src/fsdocs-tool/Program.fs: RegisteredConvertCommandin the entry pointRELEASE_NOTES.md: Added changelog entryOptions
--input.md,.fsx,.ipynb)--output(basename).(ext)--template--outputformathtmlhtml,ipynb,latex,fsx,markdown--eval--linenumbers--parametersWhen no template is provided, raw HTML content is written (just the body, no surrounding page chrome) — the same behaviour as calling
Literate.ConvertMarkdownFilewith no template.Root Cause
The
Literatelibrary already exposedConvertMarkdownFileandConvertScriptFilefor programmatic use, and theDocContentclass inside the build command already performs per-file conversion. This PR wires those existing capabilities up to a new CLI verb and adds the missingConvertPynbFilemethod.Test Status
System.Drawing.Commonvulnerability)