-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[Julia] Fix docstring parameter formatting with backticks #22190
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
base: master
Are you sure you want to change the base?
[Julia] Fix docstring parameter formatting with backticks #22190
Conversation
Wrap parameter names in backticks in generated Julia client docstrings to prevent markdown from misinterpreting underscores as italic formatting. This fixes an issue where parameter names like `pet_id`, `api_key`, and `additional_metadata` would render incorrectly in documentation, with underscores being treated as markdown italic markers instead of literal characters. Related issue: JuliaComputing/OpenAPI.jl#72
|
please follow step 3 in the PR checklist to update the samples |
Extend backtick formatting to markdown documentation templates for both Julia client and server generators. This ensures consistent markdown rendering of identifiers with underscores. Changes: - julia-client/api_doc.mustache: Add backticks to function signatures, parameter names, types, and return types in markdown API docs - julia-server/api_doc.mustache: Same changes for server API docs - julia-client/model_doc.mustache: Add backticks to property names and types in markdown model documentation - julia-server/model_doc.mustache: Same changes for server model docs All generated markdown files now properly display identifiers like `pet_id`, `Custom_Type`, `update_pet_with_form` with literal underscores instead of broken italic formatting. Related to JuliaComputing/OpenAPI.jl#72
|
thanks for the pr and updating the samples cc @tanmaykm for review |
| @@ -0,0 +1,98 @@ | |||
| # Plan: Add Backticks to All Julia Template Documentation | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this file required as part of the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely not - will put some work in on this tomorrow.
Summary
Wraps all identifiers (parameter names, function names, data types, property names, return types) in backticks in Julia client and server documentation to prevent markdown from interpreting underscores as italic formatting.
Problem
Identifiers like
pet_id,api_key,Custom_Typerender incorrectly in markdown documentation because underscores are treated as italic markers.Solution
Added backticks to all identifier references across Julia templates:
Templates Modified
Code docstrings:
julia-client/api.mustache- Function docstrings in generated Julia codeMarkdown API documentation:
julia-client/api_doc.mustache- Function signatures, parameters, return typesjulia-server/api_doc.mustache- Same for serverMarkdown model documentation:
julia-client/model_doc.mustache- Property names and typesjulia-server/model_doc.mustache- Same for serverSamples Regenerated
Both Julia client and server samples updated to demonstrate the fix.
Example
Before:
Renders with broken italics: petid
After:
Renders correctly with literal underscores.
Fixes JuliaComputing/OpenAPI.jl#72