mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
Fix experimental JSON imports
This commit is contained in:
@@ -35,6 +35,8 @@ export const ICONS = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
import { globSync } from 'glob'
|
import { globSync } from 'glob'
|
||||||
|
import { readFileSync } from "node:fs";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
|
||||||
const projects = globSync('/node_modules/Notes/Projects/*.md')
|
const projects = globSync('/node_modules/Notes/Projects/*.md')
|
||||||
.map((filepath) => {
|
.map((filepath) => {
|
||||||
@@ -69,14 +71,14 @@ function pageResolver(pageName) {
|
|||||||
// console.log()
|
// console.log()
|
||||||
// let http = grammars.find((grammar) => grammar.name == "json")
|
// let http = grammars.find((grammar) => grammar.name == "json")
|
||||||
// console.log(http)
|
// console.log(http)
|
||||||
import httpGrammar from 'tm-grammars/grammars/http.json' assert { type: "json" };
|
// import httpGrammar from 'tm-grammars/grammars/http.json' assert { type: "json" };
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
// http.grammar = httpGrammar;
|
// http.grammar = httpGrammar;
|
||||||
// console.log(httpGrammar)
|
// console.log(import.meta.resolve('tm-grammars/grammars/http.json'))
|
||||||
const httpHighlight = {
|
const httpHighlight = {
|
||||||
id: 'http',
|
id: 'http',
|
||||||
// aliases: ['http', "https"],
|
// aliases: ['http', "https"],
|
||||||
grammar: httpGrammar,
|
grammar: JSON.parse(readFileSync(fileURLToPath(import.meta.resolve('tm-grammars/grammars/http.json')), 'utf8')),
|
||||||
categories: ['web', 'utility'],
|
categories: ['web', 'utility'],
|
||||||
displayName: 'HTTP',
|
displayName: 'HTTP',
|
||||||
embedded: ['shellscript', 'json', 'xml', 'graphql'],
|
embedded: ['shellscript', 'json', 'xml', 'graphql'],
|
||||||
|
|||||||
Reference in New Issue
Block a user