-
Notifications
You must be signed in to change notification settings - Fork 0
🚀 Non-article support, community support, more updates... #6
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
Conversation
| pages.map(({ file }) => file), | ||
| { projectPath, imageExtensions: [] }, | ||
| ); | ||
| } catch (error) { |
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.
loadProject fails if myst does not find any .md/.ipynb/.myst.json files. This catch allows us to proceed with just metadata + files!
| } | ||
| if (projectFrontmatter?.parts?.abstract) { | ||
| abstractPart = parseMyst(session, projectFrontmatter.parts.abstract.join('\n\n'), configFile); | ||
| const abstractContent = castSession(session).$getMdast( |
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.
Since the full MyST processing may not complete, getting the abstract is slightly less direct...
| if (community) { | ||
| data.communities = [{ identifier: community }]; | ||
| } |
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 directly adds the published deposit to this community.
| 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)); | ||
| } |
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 is another addition: If myst.yml does not specify downloads, we just grab all the files in the same folder with given extensions.
| } | ||
| } | ||
| if (publish) { | ||
| const publishedData = await client.publishDeposition(zenodoDepositId); |
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.
Previously, this method was defined but never used. Now, if you specify --publish, the deposit will be published!
| project: { identifiers?: { zenodo?: string } }; | ||
| }; | ||
| const url = data?.project?.zenodo; | ||
| const url = data?.project?.identifiers?.zenodo; |
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.
Conforming to latest myst-frontmatter types.
| * @param error Error object | ||
| */ | ||
| private handleError(error: any): void { | ||
| private handleError(error: any): never { |
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.
Nice trick for type safety when using a function that only throws errors.
communitymyst.ymland other files, no md/ipynb article--publishflag