Here you can find a simple getting started with the Docfy Core. The core will output an object with the processed content, metadata, and some additional data structures for your convenience.
mkdir docfy-core-getting-started && cd docfy-core-getting-started
npm init
# or
yarn init
@docfy/core
as a dependencynpm install @docfy/core
# or
yarn add @docfy/core
// index.js
const Docfy = require('@docfy/core');
const path = require('path');
new Docfy()
.run([
{
root: path.join(__dirname, 'docs'),
urlPrefix: 'docs',
pattern: '**/*.md'
}
])
.then((result) => {
console.log(result);
});
mkdir docs
echo '# Hello Docfy.' > docs/README.md
Now you can run the index.js
we created earlier.
node index.js