Skip to content

Conversation

@crandmck
Copy link
Collaborator

Changes in this pull request

Refactor scripts used for sidebar and JS API docs.

Fixes #167 .

@crandmck crandmck requested a review from MassivaM January 16, 2025 18:29
label: 'Packages',
items: [terminalNode('Overview', 'index')],
collapsed: false,
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you elaborate on what's happening here? I wanna make sure I understand
Also, is there a PR in the JS SDK side to move things that we can't make open source?

Copy link
Collaborator Author

@crandmck crandmck Jan 17, 2025

Choose a reason for hiding this comment

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

This code generates the sidebar navigation for the API docs, e.g. for Packages https://opensource.contentauthenticity.org/docs/js-sdk/api/. Currently, there's only one package, c2pa.

The following is from GH co-pilot ;-)

Each key in the SIDEBAR_VISITOR object corresponds to a specific kind of API item, such as Package, Namespace, Interface, Class, and various others. The associated function for each key takes two parameters: apiItem, which represents the API item being processed, and meta, which contains metadata about the item. Depending on the kind of API item, the function either calls containerNode or terminalNode to generate the sidebar node.

Also, is there a PR in the JS SDK side to move things that we can't make open source?

The JS SDK is already open source: https://github.com/contentauth/c2pa-js
This PR doesn't do anything re that; it's only for the the code in this repo, which creates the docs.

Copy link
Contributor

Choose a reason for hiding this comment

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

so just reformatting right?
and apiItem and meta are passed into the larger function?

@crandmck
Copy link
Collaborator Author

Unfortunately the build is failing, and we can't merge this until we figure out why: https://github.com/contentauth/opensource.contentauth.org/actions/runs/12836425144/job/35797981248

@crandmck
Copy link
Collaborator Author

Rather than try to figure this out, I opened a PR to add a license to the source repo: LICENSE.

So, now we should be able to make this repo public without any problem.

@crandmck crandmck closed this Jan 22, 2025
@crandmck crandmck deleted the script-refactoring branch March 14, 2025 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make this site open source

3 participants