🚀 Non-article support, community support, more updates...#6
Conversation
| pages.map(({ file }) => file), | ||
| { projectPath, imageExtensions: [] }, | ||
| ); | ||
| } catch (error) { |
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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.
Nice trick for type safety when using a function that only throws errors.
communitymyst.ymland other files, no md/ipynb article--publishflag