I thought I'd try out JS formatting. However, with the code:
import extractSynonymsProgram from "./extractSynonymsProgram.json";
as a ```js block, I got an error:
file:///Users/joshuah/Documents/coding/living-papers/node_modules/acorn/dist/acorn.mjs:3454
var err = new SyntaxError(message);
^
SyntaxError: Unexpected token (1:7)
at pp$4.raise (file:///Users/joshuah/Documents/coding/living-papers/node_modules/acorn/dist/acorn.mjs:3454:13)
at CellParser.unexpected (file:///Users/joshuah/Documents/coding/living-papers/node_modules/@observablehq/parser/src/parse.js:207:10)
at pp$9.expect (file:///Users/joshuah/Documents/coding/living-papers/node_modules/acorn/dist/acorn.mjs:749:26)
at CellParser.parseImportSpecifiers (file:///Users/joshuah/Documents/coding/living-papers/node_modules/@observablehq/parser/src/parse.js:68:10)
at CellParser.parseImport (file:///Users/joshuah/Documents/coding/living-papers/node_modules/@observablehq/parser/src/parse.js:55:28)
at CellParser.parseCell (file:///Users/joshuah/Documents/coding/living-papers/node_modules/@observablehq/parser/src/parse.js:131:19)
at CellParser.parseTopLevel (file:///Users/joshuah/Documents/coding/living-papers/node_modules/@observablehq/parser/src/parse.js:180:17)
at CellParser.parse (file:///Users/joshuah/Documents/coding/living-papers/node_modules/acorn/dist/acorn.mjs:584:15)
at CellParser.parse (file:///Users/joshuah/Documents/coding/living-papers/node_modules/acorn/dist/acorn.mjs:634:35)
at parseCell (file:///Users/joshuah/Documents/coding/living-papers/node_modules/@observablehq/parser/src/parse.js:22:23) {
pos: 7,
loc: Position { line: 1, column: 7 },
raisedAt: 29
}
I suppose living papers is trying to parse my code with Observable's parser? Doesn't surprise me that my code isn't runnable. But I just want to format it.
(Maybe there's an option for this already?)
P.S. no worries with this issue; I don't really need colored code for my paper.
I thought I'd try out JS formatting. However, with the code:
as a ```js block, I got an error:
I suppose living papers is trying to parse my code with Observable's parser? Doesn't surprise me that my code isn't runnable. But I just want to format it.
(Maybe there's an option for this already?)
P.S. no worries with this issue; I don't really need colored code for my paper.