Skip to content

Commit

Permalink
Fix name
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt committed Jun 10, 2024
1 parent 7214954 commit 94a4b39
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
28 changes: 27 additions & 1 deletion paper/prepare-myst.ts → paper/export-pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ let [frontMatter, raw] = Deno.readTextFileSync("paper.md")
.replace("---", "")
.split("---");

let output = Deno.args[0] || "dist/paper.pdf";

let data = parse(frontMatter);
// biome-ignore lint/performance/noDelete: <explanation>
delete data["affiliations"];
Expand All @@ -15,6 +17,19 @@ delete data["tags"];
// biome-ignore lint/performance/noDelete: <explanation>
delete data["date"];

data["exports"] = {
format: "typst",
template: "lapreprint-typst",
output: output,
};

data["margin"] = [
{
"title": "Correspondence to",
"content": "Correspondence: [author-email]",
}
]

let markdown = raw
// Replace markdown images with myst images
.replace(/!\[(.*?)\]\((.*?)\)/g, (_, alt: string, filepath: string) => {
Expand All @@ -33,10 +48,21 @@ ${content}
.replace("# Overview", "# Project Overview");

Deno.writeTextFileSync(
"main.md",
"tmp.md",
`\
---
${stringify(data)}
---
${markdown}`,
);

new Deno.Command("myst", { args: ["build", "--pdf", "tmp.md"] })
.output()
.then((data) => {
console.log(data)
console.log(`PDF saved to ${output}`);
})
.catch(console.error)
.finally(async () => {
await Deno.remove("tmp.md");
});
22 changes: 10 additions & 12 deletions paper/myst.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
version: 1
project:
title: 'anywidget: reusable widgets for interactive analysis and visualization in computational notebooks'
# Authors should have affiliations, emails and ORCIDs if available
authors:
- name: Trevor Manz
email: trevor_manz@g.harvard.edu
email: "trevor\_manz@g.harvard.edu"
orcid: 0000-0001-7694-5164
affiliations:
- Department of Biomedical Informatics, Harvard Medical School, Boston, MA, USA
corresponding: true
- Department of Biomedical Informatics, Harvard Medical School
corresponding: "trevor\_[email protected]"
- name: Nezar Abdennur
email: [email protected]
email: "[email protected]"
orcid: 0000-0001-5814-0864
affiliations:
- Department of Genomics and Computational Biology, UMass Chan Medical School, Worcester, MA, USA
- Department of Systems Biology, UMass Chan Medical School, Worcester, MA, USA
- Department of Genomics and Computational Biology, UMass Chan Medical School
- Department of Systems Biology, UMass Chan Medical School
- name: Nils Gehlenborg
email: [email protected]
email: "[email protected]"
orcid: 0000-0003-0327-8297
affiliations:
- Department of Biomedical Informatics, Harvard Medical School, Boston, MA, USA
- Department of Biomedical Informatics, Harvard Medical School
keywords:
- Computational notebooks
- Jupyter
- Widgets
- Python
- R
- JavaScript
- Data visualization
- Interactive computing

abbreviations:
JCP: Jupyter Compatible Platform
AFM: Anywidget Front-End Module
Expand All @@ -37,4 +35,4 @@ project:
subject: Research Article
open_access: true
license: CC-BY-4.0
date: 2024-07-10
date: 2024-06-07

0 comments on commit 94a4b39

Please sign in to comment.