Skip to content

Commit 22ec4d0

Browse files
committed
Add support for JATs specific options
- First option, enable `link-citations` by default since this is used to produce xref elements to citations.
1 parent 9e35c41 commit 22ec4d0

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/format/formats-shared.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import {
5353
kLatexMaxRuns,
5454
kLatexOutputDir,
5555
kLatexTlmgrOpts,
56+
kLinkCitations,
5657
kLinkExternalIcon,
5758
kLinkExternalNewwindow,
5859
kMergeIncludes,
@@ -187,6 +188,18 @@ export function plaintextFormat(displayName: string, ext: string): Format {
187188
});
188189
}
189190

191+
export function jatsFormat(displayName: string, ext: string): Format {
192+
return createFormat(displayName, ext, {
193+
pandoc: {
194+
standalone: true,
195+
[kDefaultImageExtension]: "png",
196+
},
197+
metadata: {
198+
[kLinkCitations]: true,
199+
},
200+
});
201+
}
202+
190203
function defaultFormat(displayName: string): Format {
191204
return {
192205
identifier: {

src/format/formats.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
createFormat,
2828
createHtmlPresentationFormat,
2929
createWordprocessorFormat,
30+
jatsFormat,
3031
plaintextFormat,
3132
} from "./formats-shared.ts";
3233
import { revealjsFormat } from "./reveal/format-reveal.ts";
@@ -173,16 +174,16 @@ export function defaultWriterFormat(to: string): Format {
173174
break;
174175

175176
case "jats":
176-
writerFormat = plaintextFormat("JATS", "xml");
177+
writerFormat = jatsFormat("JATS", "xml");
177178
break;
178179
case "jats_archiving":
179-
writerFormat = plaintextFormat("JATS Archiving", "xml");
180+
writerFormat = jatsFormat("JATS Archiving", "xml");
180181
break;
181182
case "jats_articleauthoring":
182-
writerFormat = plaintextFormat("JATS Authoring", "xml");
183+
writerFormat = jatsFormat("JATS Authoring", "xml");
183184
break;
184185
case "jats_publishing":
185-
writerFormat = plaintextFormat("JATS Publising", "xml");
186+
writerFormat = jatsFormat("JATS Publising", "xml");
186187
break;
187188

188189
case "ipynb":

0 commit comments

Comments
 (0)