topodoc
v0.1.0
Published
A topology documentation generator to explain JavaScript codebases better.
Downloads
3
Readme
docgraph
An advanced documentation generator for JavaScript with first-class support for React. Built with ts-morph and xdm.
Features
🕸 Directed documentation graph
📝 MDX for mixing Markdown and JSX
🖼 Compiled code examples
🐇 Quick links to source code for development and production
Install
yarn add docgraph
npm install docgraph
Usage
Start by importing the [[addProject]] helper:
import { addProject } from 'docgraph'
const project = addProject()
Now that we've added a project, we can start to add information to it and describe our system. Let's add a local components
directory of React components:
const components = project.getSourceFiles('components/index.ts')
If you've chosen to skip adding files automatically or want to add specific files to your documentation graph, you can use the [[addSourceFiles]] helper:
const components = project.addSourceFiles('components/index.ts')
We can now look at any export and get the related information for it:
const component = components.getExport('Button')
component.references // array of references to this component
component.emit()