Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

@nousdev/core

Core engine for the Nous documentation pipeline: parsing, inference, rendering, and build orchestration.

Installation

npm install @nousdev/core

Usage

import { buildAll, inferAll, generateSidebar } from '@nousdev/core';
import { createMarkdownParser } from '@nousdev/parser-md';
import { createHtmlRenderer } from '@nousdev/renderer-html';

const result = await buildAll({
  contentDir: './docs',
  outDir: './dist',
  baseUrl: '/',
  parsers: [createMarkdownParser()],
  renderer: createHtmlRenderer(),
  plugins: [],
  config: {},
});

// Generate sidebar navigation from parsed documents
const sidebar = generateSidebar(result.documents, '/');

API

Pipeline

  • buildAll(options) -- full pipeline: parse, infer, transform, render; returns BuildResult
  • buildEngine(options) -- engine-only pipeline: parse, infer, transform (no rendering)
  • parseAll(options) -- parse all source files into a Map<string, DocumentNode>
  • renderAll(options) -- render pre-parsed NDM documents to HTML

Inference

  • inferAll(documents) -- run all inference passes on a document set
  • inferDocumentAnnotations(doc) -- infer block-level annotations for a single document
  • inferType(doc) -- classify document type (guide, reference, tutorial, etc.)
  • inferAudience(doc) -- determine target audience from content signals
  • inferAnswers(doc) -- extract question-answer pairs from document content

Navigation

  • generateSidebar(documents, baseUrl) -- produce a sidebar tree from document metadata
  • buildBreadcrumbs(filePath, documents) -- generate breadcrumb trail for a given path

Transforms

  • tabGroupTransform -- built-in transform that groups consecutive tab blocks into TabGroupNode

Utilities

  • slugify(text) -- convert text to a URL-safe slug
  • resolveAndDiff(original, proposed) -- compute a structured diff for suggested edits

Types

  • PipelineOptions, BuildResult, PageResult, BuildError
  • SidebarEntry, BreadcrumbItem
  • ProposedChange, AdaptationReportInput

License

MIT