Callback Extractor Plugin
Extracts content using custom callback functions for maximum flexibility.
import { CallbackExtractorPlugin } from 'simple-docs-scraper/extractors';
const extractor = new CallbackExtractorPlugin({
callback: (content) => {
// Custom extraction logic
const match = content.match(/\/\/ DOCS: (.*)/);
return match ? match[1] : undefined;
},
searchAndReplace: '// DOCS'
});
Configuration:
callback
(function): Custom extraction functionsearchAndReplace
(string): Replacement text for the extracted contentdefaultText
(optional): Default text when no content is found