完成世界书、骰子、apiconfig页面处理

This commit is contained in:
2026-04-30 01:35:10 +08:00
parent a3e3711b2b
commit ba9b925c32
4602 changed files with 785225 additions and 23 deletions

View File

@@ -0,0 +1 @@
{"version":3,"file":"blockquote.d.ts","sourceRoot":"","sources":["blockquote.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,kCAPW,KAAK,QAEL,UAAU,GAER,OAAO,CAanB;2BAvBuB,aAAa;gCADR,OAAO;6BADV,MAAM"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"break.d.ts","sourceRoot":"","sources":["break.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,iCAPW,KAAK,QAEL,KAAK,GAEH,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAQjC;2BAlBuB,aAAa;2BADb,OAAO;6BADC,MAAM;0BAAN,MAAM"}

View File

@@ -0,0 +1,20 @@
/**
* @import {Element, Properties} from 'hast'
* @import {Code} from 'mdast'
* @import {State} from '../state.js'
*/
/**
* Turn an mdast `code` node into hast.
*
* @param {State} state
* Info passed around.
* @param {Code} node
* mdast node.
* @returns {Element}
* hast node.
*/
export function code(state: State, node: Code): Element;
import type { State } from '../state.js';
import type { Code } from 'mdast';
import type { Element } from 'hast';
//# sourceMappingURL=code.d.ts.map

View File

@@ -0,0 +1,49 @@
/**
* @import {Element, Properties} from 'hast'
* @import {Code} from 'mdast'
* @import {State} from '../state.js'
*/
/**
* Turn an mdast `code` node into hast.
*
* @param {State} state
* Info passed around.
* @param {Code} node
* mdast node.
* @returns {Element}
* hast node.
*/
export function code(state, node) {
const value = node.value ? node.value + '\n' : ''
/** @type {Properties} */
const properties = {}
// Someone can write `js python	ruby`.
const language = node.lang ? node.lang.split(/\s+/) : []
// GH/CM still drop the non-first languages.
if (language.length > 0) {
properties.className = ['language-' + language[0]]
}
// Create `<code>`.
/** @type {Element} */
let result = {
type: 'element',
tagName: 'code',
properties,
children: [{type: 'text', value}]
}
if (node.meta) {
result.data = {meta: node.meta}
}
state.patch(node, result)
result = state.applyData(node, result)
// Create `<pre>`.
result = {type: 'element', tagName: 'pre', properties: {}, children: [result]}
state.patch(node, result)
return result
}

View File

@@ -0,0 +1,20 @@
/**
* @import {Element} from 'hast'
* @import {Delete} from 'mdast'
* @import {State} from '../state.js'
*/
/**
* Turn an mdast `delete` node into hast.
*
* @param {State} state
* Info passed around.
* @param {Delete} node
* mdast node.
* @returns {Element}
* hast node.
*/
export function strikethrough(state: State, node: Delete): Element;
import type { State } from '../state.js';
import type { Delete } from 'mdast';
import type { Element } from 'hast';
//# sourceMappingURL=delete.d.ts.map

View File

@@ -0,0 +1,27 @@
/**
* @import {Element} from 'hast'
* @import {Emphasis} from 'mdast'
* @import {State} from '../state.js'
*/
/**
* Turn an mdast `emphasis` node into hast.
*
* @param {State} state
* Info passed around.
* @param {Emphasis} node
* mdast node.
* @returns {Element}
* hast node.
*/
export function emphasis(state, node) {
/** @type {Element} */
const result = {
type: 'element',
tagName: 'em',
properties: {},
children: state.all(node)
}
state.patch(node, result)
return state.applyData(node, result)
}

View File

@@ -0,0 +1,27 @@
/**
* @import {Element} from 'hast'
* @import {Heading} from 'mdast'
* @import {State} from '../state.js'
*/
/**
* Turn an mdast `heading` node into hast.
*
* @param {State} state
* Info passed around.
* @param {Heading} node
* mdast node.
* @returns {Element}
* hast node.
*/
export function heading(state, node) {
/** @type {Element} */
const result = {
type: 'element',
tagName: 'h' + node.depth,
properties: {},
children: state.all(node)
}
state.patch(node, result)
return state.applyData(node, result)
}

View File

@@ -0,0 +1,15 @@
/**
* Turn an mdast `imageReference` node into hast.
*
* @param {State} state
* Info passed around.
* @param {ImageReference} node
* mdast node.
* @returns {Array<ElementContent> | ElementContent}
* hast node.
*/
export function imageReference(state: State, node: ImageReference): Array<ElementContent> | ElementContent;
import type { State } from '../state.js';
import type { ImageReference } from 'mdast';
import type { ElementContent } from 'hast';
//# sourceMappingURL=image-reference.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"image-reference.d.ts","sourceRoot":"","sources":["image-reference.js"],"names":[],"mappings":"AASA;;;;;;;;;GASG;AACH,sCAPW,KAAK,QAEL,cAAc,GAEZ,KAAK,CAAC,cAAc,CAAC,GAAG,cAAc,CAsBlD;2BAnCuB,aAAa;oCADJ,OAAO;oCADc,MAAM"}

View File

@@ -0,0 +1,55 @@
export namespace handlers {
export { blockquote };
export { hardBreak as break };
export { code };
export { strikethrough as delete };
export { emphasis };
export { footnoteReference };
export { heading };
export { html };
export { imageReference };
export { image };
export { inlineCode };
export { linkReference };
export { link };
export { listItem };
export { list };
export { paragraph };
export { root };
export { strong };
export { table };
export { tableCell };
export { tableRow };
export { text };
export { thematicBreak };
export { ignore as toml };
export { ignore as yaml };
export { ignore as definition };
export { ignore as footnoteDefinition };
}
import { blockquote } from './blockquote.js';
import { hardBreak } from './break.js';
import { code } from './code.js';
import { strikethrough } from './delete.js';
import { emphasis } from './emphasis.js';
import { footnoteReference } from './footnote-reference.js';
import { heading } from './heading.js';
import { html } from './html.js';
import { imageReference } from './image-reference.js';
import { image } from './image.js';
import { inlineCode } from './inline-code.js';
import { linkReference } from './link-reference.js';
import { link } from './link.js';
import { listItem } from './list-item.js';
import { list } from './list.js';
import { paragraph } from './paragraph.js';
import { root } from './root.js';
import { strong } from './strong.js';
import { table } from './table.js';
import { tableCell } from './table-cell.js';
import { tableRow } from './table-row.js';
import { text } from './text.js';
import { thematicBreak } from './thematic-break.js';
declare function ignore(): undefined;
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,23 @@
/**
* @import {ElementContent, Element, Properties} from 'hast'
* @import {ListItem, Parents} from 'mdast'
* @import {State} from '../state.js'
*/
/**
* Turn an mdast `listItem` node into hast.
*
* @param {State} state
* Info passed around.
* @param {ListItem} node
* mdast node.
* @param {Parents | undefined} parent
* Parent of `node`.
* @returns {Element}
* hast node.
*/
export function listItem(state: State, node: ListItem, parent: Parents | undefined): Element;
import type { State } from '../state.js';
import type { ListItem } from 'mdast';
import type { Parents } from 'mdast';
import type { Element } from 'hast';
//# sourceMappingURL=list-item.d.ts.map

View File

@@ -0,0 +1,20 @@
/**
* @import {Element} from 'hast'
* @import {Paragraph} from 'mdast'
* @import {State} from '../state.js'
*/
/**
* Turn an mdast `paragraph` node into hast.
*
* @param {State} state
* Info passed around.
* @param {Paragraph} node
* mdast node.
* @returns {Element}
* hast node.
*/
export function paragraph(state: State, node: Paragraph): Element;
import type { State } from '../state.js';
import type { Paragraph } from 'mdast';
import type { Element } from 'hast';
//# sourceMappingURL=paragraph.d.ts.map

View File

@@ -0,0 +1,20 @@
/**
* @import {Element} from 'hast'
* @import {Strong} from 'mdast'
* @import {State} from '../state.js'
*/
/**
* Turn an mdast `strong` node into hast.
*
* @param {State} state
* Info passed around.
* @param {Strong} node
* mdast node.
* @returns {Element}
* hast node.
*/
export function strong(state: State, node: Strong): Element;
import type { State } from '../state.js';
import type { Strong } from 'mdast';
import type { Element } from 'hast';
//# sourceMappingURL=strong.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"strong.d.ts","sourceRoot":"","sources":["strong.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,8BAPW,KAAK,QAEL,MAAM,GAEJ,OAAO,CAanB;2BAvBuB,aAAa;4BADZ,OAAO;6BADN,MAAM"}

View File

@@ -0,0 +1,27 @@
/**
* @import {Element} from 'hast'
* @import {Strong} from 'mdast'
* @import {State} from '../state.js'
*/
/**
* Turn an mdast `strong` node into hast.
*
* @param {State} state
* Info passed around.
* @param {Strong} node
* mdast node.
* @returns {Element}
* hast node.
*/
export function strong(state, node) {
/** @type {Element} */
const result = {
type: 'element',
tagName: 'strong',
properties: {},
children: state.all(node)
}
state.patch(node, result)
return state.applyData(node, result)
}

View File

@@ -0,0 +1,24 @@
/**
* @import {Element as HastElement, Text as HastText} from 'hast'
* @import {Text as MdastText} from 'mdast'
* @import {State} from '../state.js'
*/
import {trimLines} from 'trim-lines'
/**
* Turn an mdast `text` node into hast.
*
* @param {State} state
* Info passed around.
* @param {MdastText} node
* mdast node.
* @returns {HastElement | HastText}
* hast node.
*/
export function text(state, node) {
/** @type {HastText} */
const result = {type: 'text', value: trimLines(String(node.value))}
state.patch(node, result)
return state.applyData(node, result)
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"thematic-break.d.ts","sourceRoot":"","sources":["thematic-break.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,qCAPW,KAAK,QAEL,aAAa,GAEX,OAAO,CAanB;2BAvBuB,aAAa;mCADL,OAAO;6BADb,MAAM"}