Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement →
Sign In

@docmd/plugin-search

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@docmd/plugin-search - npm Package Compare versions

Comparing version
0.5.0
to
0.5.1
+20
-4
index.js

@@ -23,5 +23,5 @@ /**

if (!isEnabled) return;
if(log) log('šŸ” Generating search index...');
if (log) log('šŸ” Generating search index...');
const searchData = [];

@@ -33,3 +33,4 @@ pages.forEach(page => {

if (pageId.endsWith('.html')) pageId = pageId.slice(0, -5);
// 1. Add the main page record
searchData.push({

@@ -39,4 +40,19 @@ id: pageId,

text: page.searchData.content,
headings: (page.searchData.headings || []).join(' ')
// We can keep page-level headings as a string block for general page matching
headings: (page.searchData.headings || []).map(h => h.text).join(' ')
});
// 2. Add individual heading records for deep linking
if (page.searchData.headings && Array.isArray(page.searchData.headings)) {
page.searchData.headings.forEach(heading => {
if (heading.id && heading.text) {
searchData.push({
id: `${pageId}#${heading.id}`,
title: `${page.searchData.title} > ${heading.text}`,
text: '', // The content under the heading could go here if we extracted it, but for now empty or short
headings: heading.text
});
}
});
}
}

@@ -43,0 +59,0 @@ });

+2
-2
{
"name": "@docmd/plugin-search",
"version": "0.5.0",
"description": "Offline full-text search for docmd",
"version": "0.5.1",
"description": "Offline full-text search for docmd.",
"main": "index.js",

@@ -6,0 +6,0 @@ "dependencies": {

@@ -9,3 +9,3 @@ # @docmd/plugin-search

## The docmd Ecosystem
## The `docmd` Ecosystem

@@ -25,2 +25,3 @@ `docmd` is a modular system. Here are the official packages:

* [**@docmd/plugin-search**](https://www.npmjs.com/package/@docmd/plugin-search) - Offline full-text search.
* [**@docmd/plugin-pwa**](https://www.npmjs.com/package/@docmd/plugin-pwa) - Progressive Web App support.
* [**@docmd/plugin-mermaid**](https://www.npmjs.com/package/@docmd/plugin-mermaid) - Diagrams and flowcharts.

@@ -27,0 +28,0 @@ * [**@docmd/plugin-seo**](https://www.npmjs.com/package/@docmd/plugin-seo) - Meta tags and Open Graph data.