Skip to content

Add table rendering for Apple doc JSON#27

Merged
mattt merged 1 commit intomainfrom
mattt/tables
Feb 10, 2026
Merged

Add table rendering for Apple doc JSON#27
mattt merged 1 commit intomainfrom
mattt/tables

Conversation

@mattt
Copy link
Copy Markdown
Member

@mattt mattt commented Feb 10, 2026

Resolves #26

On pages like https://developer.apple.com/documentation/professional-video-applications/import-options, Sosumi.ai wasn't rendering table content (https://sosumi.ai/documentation/professional-video-applications/import-options?language=objc).

This PR adds code to render tables in GFM / CommonMark format.

  ## Overview
  
  The `import-options` element can contain zero or more `option` elements. The `option` element describes options for importing events and projects into Final Cut Pro through the key-value pair in the attributes listed below.
  
+ | Attributes | Description |
+ | --- | --- |
+ | `key` | A string that identifies one of the following import options:  `copy assets`: Copy or link assets referenced in the imported XML. Valid values are `1` (copy) and `0` (link).    `library location`: Specifies the location (URL) of the library to which to add the event or project. If the specified URL represents a directory, Final Cut Pro uses the default library name. If no library exists at the location specified in the XML, Final Cut Pro creates a new library.  `suppress warnings`: Suppress or show warnings generated during import. Valid values are `≥1` (suppress) and `0` (show)   `base url`: A URL to resolve a relative URL given in the XML as the value of the `src` attribute of a `resources` element. |
+ | `value` | The value for the import option. |

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Markdown table rendering support to the Apple documentation JSON renderer so table content from ProApps docs is displayed correctly on Sosumi.ai (fixing missing information noted in #26).

Changes:

  • Extend the main content renderer to handle type: "table" items.
  • Implement a renderTable helper that emits GFM/CommonMark table syntax from Apple’s header: "row" + rows structure.
  • Add a unit test validating header + separator + body row output for table rendering.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/lib/reference/render.ts Adds type: "table" handling and implements renderTable to output GFM tables from Apple doc JSON.
tests/render.test.ts Adds a table-rendering test case to prevent regressions and validate expected Markdown output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mattt mattt merged commit 157b8d7 into main Feb 10, 2026
8 checks passed
@mattt mattt deleted the mattt/tables branch February 10, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Better handling of Apple ProApps Documentation

2 participants