fix(core): update

This commit is contained in:
2022-06-10 14:14:00 +02:00
commit 6ac2dd12cc
15 changed files with 13896 additions and 0 deletions

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartdocumentation',
version: '1.0.2',
description: 'a tool for mapping git directories to documentation sites'
}

3
ts/index.ts Normal file
View File

@ -0,0 +1,3 @@
import * as plugins from './smartdocumentation.plugins.js';
export let demoExport = 'Hi there! :) This is an exported string';

View File

@ -0,0 +1,48 @@
import * as plugins from './smartdocumentation.plugins.js';
export interface IDocumentationDirectoryConstructorOptions {
pathArg: string;
}
/**
* a documentation directory maps to a directory with markdown documents
*/
export class DocumentationDirectory {
public options: IDocumentationDirectoryConstructorOptions;
public smartmarkdownInstance = new plugins.smartmarkdown.SmartMarkdown();
public articles: plugins.tsclass.content.IArticle[];
constructor(optionsArg: IDocumentationDirectoryConstructorOptions) {
this.options = optionsArg;
}
/**
* reads a directory
*/
public async readDirectory() {
const fileTreeComplete = await plugins.smartfile.fs.fileTreeToObject(
this.options.pathArg,
'**/*'
);
const articles: plugins.tsclass.content.IArticle[] = [];
for (const markdownFile of fileTreeComplete.filter(
(fileArg) => fileArg.parsedPath.ext === '.md'
)) {
const parsedMarkdown = await this.smartmarkdownInstance.getMdParsedResultFromMarkdown(markdownFile.contents.toString())
articles.push({
title: parsedMarkdown.title,
author: parsedMarkdown.frontmatterData.author,
content: parsedMarkdown.originalString,
timestamp: Date.now(),
tags: [
`path:${markdownFile.path}`,
],
});
}
this.articles = articles;
}
sendAsDocumentationSet(nameArg: string, targetArg: string) {
}
}

View File

@ -0,0 +1,9 @@
import * as tsclass from '@tsclass/tsclass';
import * as smartfile from '@pushrocks/smartfile';
import * as smartmarkdown from '@pushrocks/smartmarkdown';
export {
tsclass,
smartfile,
smartmarkdown,
}