Extracts all unique xrefs from asciidoc files.
npm install --save asciidoc-xref-extractor
Parameters:
asciidocFile
is a string in asciidoc format.
Returns:
- an array containing all unique xrefs from the file.
"use strict";
var fs = require('fs');
var asciidocXrefExtractor = require(asciidoc-xref-extractor);
var asciidocFile = fs.readFileSync("./test.adoc").toString();
var xrefs = asciidocXrefExtractor(asciidocFile);
xrefs.forEach(function (xref) {
console.log(xref);
});