Skip to content

Commit

Permalink
bunch of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Feb 14, 2024
1 parent 212c05d commit 317ea21
Show file tree
Hide file tree
Showing 43 changed files with 978 additions and 752 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
dev: build
npm run test:dev

build: clean
npm run build

clean:
rm -rf dist

test: build
npm run test:dev
npm run test

publish: test
npm publish --access public
13 changes: 10 additions & 3 deletions dist/document.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Element } from "./element";
import { ParseNodes } from "./parse_nodes";
import { v4 as uuidv4 } from 'uuid';
export class Document extends Element {
constructor(el) {
Expand All @@ -14,13 +13,21 @@ export class Document extends Element {
this.file = "module.md";
}
this.id = el.id ? el.id : uuidv4();
this.nodes = ParseNodes(el.nodes);
this.nodes = el.nodes;
// this.nodes = ParseNodes(el.nodes);
}
toString() {
var _a;
let s = "";
(_a = this.nodes) === null || _a === void 0 ? void 0 : _a.forEach((n) => {
s += n.toString();
if (Array.isArray(n)) {
n.forEach((n) => {
s += n.toString();
});
}
else {
s += n.toString();
}
});
return s;
}
Expand Down
9 changes: 8 additions & 1 deletion dist/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ export class Element {
(_a = this.nodes) === null || _a === void 0 ? void 0 : _a.forEach((n) => {
if (n === undefined)
return;
s += n.toString();
if (Array.isArray(n)) {
n.forEach((n) => {
s += n.toString();
});
}
else {
s += n.toString();
}
});
if (this.atom === undefined)
return s;
Expand Down
2 changes: 2 additions & 0 deletions dist/empty_mod.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { Module } from "./module";
export declare function EmptyModule(): Module;
11 changes: 11 additions & 0 deletions dist/empty_mod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Module } from "./module";
import { Document } from "./document";
export function EmptyModule() {
return new Module({
id: "",
doc: new Document({}),
dir: "",
filepath: "",
name: "",
});
}
21 changes: 13 additions & 8 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export type { Node } from "./node";
export { Cmd } from "./cmd";
export { CmdResult } from "./cmd_result";
export { Document } from "./document";
export { Element } from "./element";
export { EmptyModule } from "./empty_mod";
export { FencedCode } from "./fenced_code";
export { FigCaption } from "./fig_caption";
export { Figure } from "./figure";
Expand All @@ -10,20 +11,24 @@ export { Image } from "./image";
export { Include } from "./include";
export { InlineCode } from "./inline_code";
export { LI } from "./li";
export { Link, NewLink } from "./link";
export { NewElement, Element } from "./element";
export { NewText, Text } from "./text";
export { NewUL, UL } from "./ul";
export { Link } from "./link";
export { Module } from "./module";
export { NewElement } from "./element";
export { NewLink } from "./link";
export { NewText } from "./text";
export { NewUL } from "./ul";
export { Node } from "./node";
export { OL } from "./ol";
export { Page } from "./page";
export { PostMarshaller } from "./callbacks";
export { Parser } from "./parser";
export { Ref } from "./ref";
export { Snippet } from "./snippet";
export { SourceCode } from "./source_code";
export { Table } from "./table";
export { Text } from "./text";
export { Toc } from "./toc";
export type { VisitNode } from "./visit_node";
export { ParseNodes } from "./parse_nodes";
export { UL } from "./ul";
export { VisitAtom } from "./visit_atom";
export { VisitNode } from "./visit_node";
export { atoms } from "./atoms";
export { gotypes } from "./gotypes";
Loading

0 comments on commit 317ea21

Please sign in to comment.