{"id":29945288,"url":"https://github.com/langworr/markdown-it-analytical-index","last_synced_at":"2026-01-20T17:36:01.287Z","repository":{"id":308869386,"uuid":"1034321066","full_name":"langworr/markdown-it-analytical-index","owner":"langworr","description":"Create automaticaly an analytical index in Markdown documents using markdown-it.","archived":false,"fork":false,"pushed_at":"2025-08-08T10:03:16.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"dev-ts","last_synced_at":"2025-08-08T12:14:47.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/langworr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-08T07:49:56.000Z","updated_at":"2025-08-08T07:55:20.000Z","dependencies_parsed_at":"2025-08-08T12:14:56.781Z","dependency_job_id":"592c1493-aa2c-4cf9-958a-d310897e87f6","html_url":"https://github.com/langworr/markdown-it-analytical-index","commit_stats":null,"previous_names":["langworr/markdown-it-analytical-index"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/langworr/markdown-it-analytical-index","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langworr%2Fmarkdown-it-analytical-index","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langworr%2Fmarkdown-it-analytical-index/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langworr%2Fmarkdown-it-analytical-index/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langworr%2Fmarkdown-it-analytical-index/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/langworr","download_url":"https://codeload.github.com/langworr/markdown-it-analytical-index/tar.gz/refs/heads/dev-ts","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langworr%2Fmarkdown-it-analytical-index/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271166379,"owners_count":24710474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","markdown-it-plugin"],"created_at":"2025-08-03T05:01:17.801Z","updated_at":"2025-08-21T02:07:55.357Z","avatar_url":"https://github.com/langworr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# markdown-it-analytical-index\n\n[![npm version](https://img.shields.io/npm/v/markdown-it-analytical-index.svg)](https://www.npmjs.com/package/markdown-it-analytical-index)\n[![Downloads/month](https://img.shields.io/npm/dm/markdown-it-analytical-index.svg)](https://www.npmjs.com/package/markdown-it-analytical-index)\n[![License](https://img.shields.io/npm/l/markdown-it-analytical-index.svg)](LICENSE)\n[![TypeScript](https://img.shields.io/badge/typed-TypeScript-blue.svg)](https://www.typescriptlang.org/)\n\nA plugin for [markdown-it](https://github.com/markdown-it/markdown-it) that generates a semantic analytical index based on specially marked terms within the Markdown text.\n\nThe plugin detects words marked with a customizable marker and wraps them in HTML tags with unique anchors, then creates a list of references at a designated placeholder location using `\u003c!-- @analytical-index: Index title --\u003e`.\n\n---\n\n## Installation\n\nInstall via npm:\n\n```bash\nnpm install markdown-it-analytical-index\n```\n\n---\n\n## Basic Usage\n\n```js\nconst MarkdownIt = require(\"markdown-it\")\nconst analyticalIndex = require(\"markdown-it-analytical-index\")\n\nconst md = new MarkdownIt({ html: true })\n  .use(analyticalIndex, {\n    marker: \"!!\",             // Optional marker, \"!!\" is the default. \n    headingLevel: 3,          // Optional heading level (defaults to h2).\n    sortOrder: \"alphabetical\" // Optional sort order: \"occurrence\" | \"alphabetical\"\n                              // Default is \"alphabetical\" \n  })\n\nconst input = `\nThis sentence contains [[symmetry]] and also [[contrast]].\n\n\u003c!-- @analytical-index: Index --\u003e\n`\n\nconst output = md.render(input)\n```\n\n---\n\n## Supported Syntax\n\n| Input | Description |\n|---|---|\n| `[[Term]]` | Highlights the term and links it in the index |\n| `\u003c!-- @analytical-index: Analytical index --\u003e` | Placeholder for the index location and its title.\u003cbr\u003eIf the title is not specified, it will be \"Analytical Index\".\u003cbr\u003eIf the placeholder is not present, the index will not appear. |\n\n---\n\n## Options\n\nPass an object when registering the plugin to customize output:\n\n| Option         | Type     | Default            | Description                                                    |\n|----------------|----------|--------------------|----------------------------------------------------------------|\n| `marker`       | string   | `\"!!\"`             | Marker for terms (e.g. `!!` for `!![term]` or use `[[term]]` by default) |\n| `headingLevel` | number   | `2`                | HTML heading level for the index title (e.g. `h2`, `h3`)       |\n| `sortOrder`    | `\"occurrence\" \\| \"alphabetical\"` | `\"alphabetical\"` | Order the terms by occurrence number or alphabetically         |\n\n---\n\n## HTML Output Example\n\nGiven this Markdown:\n\n```markdown\nHere is a concept: [[symmetry]] and another: [[contrast]].\n\n\u003c!-- @analytical-index: Cool index --\u003e\n```\n\nThe plugin will render HTML similar to:\n\n```html\n\u003cp\u003eHere is a concept: \u003cspan id=\"symmetry-1\"\u003esymmetry\u003c/span\u003e and another:\n\u003cspan id=\"contrast-1\"\u003econtrast\u003c/span\u003e\u003c/p\u003e\n\n\u003ch3\u003eCool index\u003c/h3\u003e\n\u003cp\u003e\u003cstrong\u003eSymmetry\u003c/strong\u003e → \u003ca href=\"#symmetry-1\"\u003e1\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eContrast\u003c/strong\u003e → \u003ca href=\"#contrast-1\"\u003e1\u003c/a\u003e\u003c/p\u003e\n```\n\nEach term receives a unique anchor and is listed with clickable references in the index.\n\n---\n\n## Notes\n\n- The index is generated **only** if the special comment `\u003c!-- @analytical-index --\u003e` (with or with a title) is present in the Markdown.\n- The index title can be set with the placeholder comment.\n- If no bracketed terms are found, the index is not rendered.\n- The plugin supports multiple references to the same term and automatically increments the index.\n\n---\n\n## License\n\nMIT — free to use, modify, and distribute.\n\n---\n\n## Author\n\nCreated by Roberto.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangworr%2Fmarkdown-it-analytical-index","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flangworr%2Fmarkdown-it-analytical-index","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangworr%2Fmarkdown-it-analytical-index/lists"}