Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in documentation generation #4502

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .release-notes/bad-doc-gen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Fix incorrect markdown formatting for types from documentation generation

Previously, we were incorrectly creating field types in markdown documentation. The markdown for the type should have been on a single line but for long union types, it would end up crossing lines. That resulted in broken markdown that wouldn't display correctly.
2 changes: 1 addition & 1 deletion src/libponyc/pass/docgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ static void doc_fields(docgen_t* docgen, docgen_opt_t* docgen_opt,
}

fprintf(docgen->type_file, "### %s %s: ", ftype, name);
doc_type(docgen, docgen_opt, type, true, true);
doc_type(docgen, docgen_opt, type, true, false);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the last parameter is "is it ok the break the lines". It isn't in the case @redvers identified.

add_source_code_link(docgen, field);
fprintf(docgen->type_file, "\n");

Expand Down
Loading