@promptbook/cli 0.72.0-28 → 0.72.0-29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,10 @@ export declare class WebsiteScraper implements Converter, Scraper {
24
24
  * Markdown scraper is used internally
25
25
  */
26
26
  private readonly markdownScraper;
27
+ /**
28
+ * Showdown converter is used internally
29
+ */
30
+ private readonly showdownConverter;
27
31
  constructor(tools: Pick<ExecutionTools, 'fs' | 'llm'>, options: PrepareAndScrapeOptions);
28
32
  /**
29
33
  * Convert the website to `.md` file and returns intermediate source
@@ -0,0 +1,7 @@
1
+ import { Converter as ShowdownConverter } from 'showdown';
2
+ /**
3
+ * Create a new showdown converter instance
4
+ *
5
+ * @private utility of `WebsiteScraper`
6
+ */
7
+ export declare function createShowdownConverter(): ShowdownConverter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/cli",
3
- "version": "0.72.0-28",
3
+ "version": "0.72.0-29",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
package/umd/index.umd.js CHANGED
@@ -39,7 +39,7 @@
39
39
  /**
40
40
  * The version of the Promptbook library
41
41
  */
42
- var PROMPTBOOK_VERSION = '0.72.0-27';
42
+ var PROMPTBOOK_VERSION = '0.72.0-28';
43
43
  // TODO: [main] !!!! List here all the versions and annotate + put into script
44
44
 
45
45
  /*! *****************************************************************************
@@ -14099,6 +14099,28 @@
14099
14099
  */
14100
14100
  var _WebsiteScraperMetadataRegistration = $scrapersMetadataRegister.register(websiteScraperMetadata);
14101
14101
 
14102
+ /**
14103
+ * Create a new showdown converter instance
14104
+ *
14105
+ * @private utility of `WebsiteScraper`
14106
+ */
14107
+ function createShowdownConverter() {
14108
+ return new showdown.Converter({
14109
+ flavor: 'github',
14110
+ /*
14111
+ > import showdownHighlight from 'showdown-highlight';
14112
+ > extensions: [
14113
+ > showdownHighlight({
14114
+ > // Whether to add the classes to the <pre> tag, default is false
14115
+ > pre: true,
14116
+ > // Whether to use hljs' auto language detection, default is true
14117
+ > auto_detection: true,
14118
+ > }),
14119
+ > ],
14120
+ */
14121
+ });
14122
+ }
14123
+
14102
14124
  /**
14103
14125
  * Scraper for websites
14104
14126
  *
@@ -14110,9 +14132,12 @@
14110
14132
  this.tools = tools;
14111
14133
  this.options = options;
14112
14134
  this.markdownScraper = new MarkdownScraper(tools, options);
14135
+ // TODO: !!!!!! Remove
14113
14136
  TODO_USE(readability.Readability);
14114
14137
  TODO_USE(showdown.Converter);
14115
14138
  TODO_USE(jsdom.JSDOM);
14139
+ TODO_USE(createShowdownConverter);
14140
+ this.showdownConverter = createShowdownConverter();
14116
14141
  }
14117
14142
  Object.defineProperty(WebsiteScraper.prototype, "metadata", {
14118
14143
  /**
@@ -14133,9 +14158,6 @@
14133
14158
  return __awaiter(this, void 0, void 0, function () {
14134
14159
  var markdown;
14135
14160
  return __generator(this, function (_a) {
14136
- if (source.url === null) {
14137
- throw new KnowledgeScrapeError('Website scraper requires URL');
14138
- }
14139
14161
  markdown = "";
14140
14162
  return [2 /*return*/, __assign(__assign({}, source), { markdown: markdown, destroy: function () { } })];
14141
14163
  });