defuddle 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/constants.d.ts +14 -0
- package/dist/defuddle.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/math.d.ts +14 -0
- package/dist/metadata.d.ts +1 -0
- package/dist/types.d.ts +2 -0
- package/package.json +6 -2
package/dist/math.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface MathData {
|
|
2
|
+
mathml: string;
|
|
3
|
+
latex: string | null;
|
|
4
|
+
isBlock: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const getMathMLFromElement: (el: Element) => MathData | null;
|
|
7
|
+
export declare const getLatexFromElement: (el: Element) => string | null;
|
|
8
|
+
export declare const isBlockDisplay: (el: Element) => boolean;
|
|
9
|
+
export declare const createCleanMathEl: (mathData: MathData | null, latex: string | null, isBlock: boolean) => Element;
|
|
10
|
+
export declare const mathStandardizationRules: {
|
|
11
|
+
selector: string;
|
|
12
|
+
element: string;
|
|
13
|
+
transform: (el: Element) => Element;
|
|
14
|
+
}[];
|
package/dist/metadata.d.ts
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -4,10 +4,12 @@ export interface DefuddleMetadata {
|
|
|
4
4
|
domain: string;
|
|
5
5
|
favicon: string;
|
|
6
6
|
image: string;
|
|
7
|
+
parseTime: number;
|
|
7
8
|
published: string;
|
|
8
9
|
author: string;
|
|
9
10
|
site: string;
|
|
10
11
|
schemaOrgData: any;
|
|
12
|
+
wordCount: number;
|
|
11
13
|
}
|
|
12
14
|
export interface DefuddleResponse extends DefuddleMetadata {
|
|
13
15
|
content: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "defuddle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Extract article content and metadata from web pages.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -34,7 +34,11 @@
|
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/kepano/defuddle/issues"
|
|
36
36
|
},
|
|
37
|
-
"homepage": "https://github.com/kepano/defuddle
|
|
37
|
+
"homepage": "https://github.com/kepano/defuddle",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"mathml-to-latex": "^1.4.3",
|
|
40
|
+
"temml": "^0.11.2"
|
|
41
|
+
},
|
|
38
42
|
"devDependencies": {
|
|
39
43
|
"@types/node": "^20.0.0",
|
|
40
44
|
"concurrently": "^8.2.2",
|