-
Notifications
You must be signed in to change notification settings - Fork 92
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
[WIP] Preliminary support for the C API in the MDX pipeline #2767
base: main
Are you sure you want to change the base?
Conversation
fix naming
fix naming
function buildCApiFunction(h: H, node: any) { | ||
// We use the first child as the signature | ||
node.properties.signature = toText(node.children[0]).trim(); | ||
node.children = node.children.splice(1, 1); | ||
|
||
// We use the Function component for C functions | ||
node.tagName = "function"; | ||
|
||
return buildApiComponent(h, node); | ||
} | ||
|
||
function buildCApiStruct(h: H, node: any) { |
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.
I divided it into two functions because I think the implementation of functions and structs will diverge when handling all the edge cases.
): void { | ||
const modulePrefix = "module-"; | ||
const modulePrefix = isCApi ? "group__" : "module-"; |
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.
I kept the meta.apiType
as module
because in my opinion it is strange to have the apiType
as group
when a single file contains several groups on it. In addition we want the same behavior in the TOC as the python modules
@@ -112,6 +110,7 @@ async function convertFilesToMarkdown( | |||
imageDestination: pkg.outputDir("/images"), | |||
releaseNotesTitle: pkg.releaseNotesTitle(), | |||
hasSeparateReleaseNotes: pkg.hasSeparateReleaseNotes(), | |||
isCApi: pkg.language == "C", |
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.
This parameter is useful to handle some C API specifics that we don't want for our Python APIs
Moving to a draft to explore an alternative to generate functions and structs that it occurred to me and that could make the changes cleaner and easy to maintain. |
This PR adds support for the Qiskit SDK C API in our MDX pipeline.
For the moment, we are using the python
Function
andClass
components to represent the C functions and structs respectively.I generated the docs by running: