extract-from-sitemap 0.0.15 → 0.0.17

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.
Files changed (2) hide show
  1. package/cli.js +5 -6
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -502,7 +502,7 @@ function getPathPrefix(topLevelOutDir, sourceOutDir) {
502
502
  * @returns {string} Combined llms.txt content
503
503
  */
504
504
  function generateCombinedLlmsTxt(title, description, details, allSources) {
505
- let combinedTxt = `# Documentation Collection\n\n> ${description}\n\n`;
505
+ let combinedTxt = `# ${title}\n\n> ${description}\n\n`;
506
506
 
507
507
  if (details) {
508
508
  combinedTxt += `${details}\n\n`;
@@ -519,7 +519,9 @@ function generateCombinedLlmsTxt(title, description, details, allSources) {
519
519
  for (const [path, file] of sortedFiles) {
520
520
  if (file.content || file.title) {
521
521
  const title = file.title || path.replace(".md", "");
522
- const description = file.description ? `: ${file.description}` : "";
522
+ const description = file.description
523
+ ? `: ${file.description.replaceAll("\n", " ")}`
524
+ : "";
523
525
 
524
526
  // Generate link based on keepOriginalUrls and pathPrefix
525
527
  let link;
@@ -529,10 +531,7 @@ function generateCombinedLlmsTxt(title, description, details, allSources) {
529
531
  link = source.pathPrefix + (path.startsWith("/") ? path : "/" + path);
530
532
  }
531
533
 
532
- combinedTxt += `- [${title}](${link}): ${description.replaceAll(
533
- "\n",
534
- " "
535
- )}\n`;
534
+ combinedTxt += `- [${title}](${link})${description}\n`;
536
535
  }
537
536
  }
538
537
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "extract-from-sitemap",
3
3
  "bin": "cli.js",
4
- "version": "0.0.15",
4
+ "version": "0.0.17",
5
5
  "main": "mod.js",
6
6
  "description": "A module and CLI that allows extracting all pages from a sitemap into markdown and a llms.txt, using Parallel.ai APIs.",
7
7
  "files": [