Skip to content

🚀 Non-article support, community support, more updates...#6

Merged
fwkoch merged 3 commits into
mainfrom
updates-2025
Oct 9, 2025
Merged

🚀 Non-article support, community support, more updates...#6
fwkoch merged 3 commits into
mainfrom
updates-2025

Conversation

@fwkoch

@fwkoch fwkoch commented Oct 8, 2025

Copy link
Copy Markdown
Member
  • update myst libraries to latest
  • support community
  • allow depositing from a simple folder with just a myst.yml and other files, no md/ipynb article
  • hook up --publish flag

Comment thread src/cli/deposit.ts
pages.map(({ file }) => file),
{ projectPath, imageExtensions: [] },
);
} catch (error) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

loadProject fails if myst does not find any .md/.ipynb/.myst.json files. This catch allows us to proceed with just metadata + files!

Comment thread src/cli/deposit.ts
}
if (projectFrontmatter?.parts?.abstract) {
abstractPart = parseMyst(session, projectFrontmatter.parts.abstract.join('\n\n'), configFile);
const abstractContent = castSession(session).$getMdast(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Since the full MyST processing may not complete, getting the abstract is slightly less direct...

Comment thread src/cli/deposit.ts
Comment on lines +442 to +444
if (community) {
data.communities = [{ identifier: community }];
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This directly adds the published deposit to this community.

Comment thread src/cli/deposit.ts
Comment on lines +478 to +483
if (!filesToUpload?.length) {
filesToUpload = fs
.readdirSync(path.dirname(configFile))
.filter((file) => DEPOSIT_FILE_EXTENSIONS.find((ext) => file.toLowerCase().endsWith(ext)))
.map((file) => path.resolve(path.dirname(configFile), file));
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is another addition: If myst.yml does not specify downloads, we just grab all the files in the same folder with given extensions.

Comment thread src/cli/deposit.ts
}
}
if (publish) {
const publishedData = await client.publishDeposition(zenodoDepositId);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Previously, this method was defined but never used. Now, if you specify --publish, the deposit will be published!

Comment thread src/cli/deposit.ts
project: { identifiers?: { zenodo?: string } };
};
const url = data?.project?.zenodo;
const url = data?.project?.identifiers?.zenodo;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Conforming to latest myst-frontmatter types.

Comment thread src/cli/utils.ts Outdated
Comment thread src/index.ts
* @param error Error object
*/
private handleError(error: any): void {
private handleError(error: any): never {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nice trick for type safety when using a function that only throws errors.

@fwkoch fwkoch merged commit aa13918 into main Oct 9, 2025
3 checks passed
@fwkoch fwkoch deleted the updates-2025 branch October 9, 2025 16:53
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.

1 participant