Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Table of Contents (ToC) generator for Astro. Use custom components for interactivity.
Table of Contents (ToC) generator for Astro.
npm install astro-toc
default
This is render mode can render your toc
as <ul>
, <ol>
or <menu>
; set the style
property to select your flavour.
Property | Type | Description |
---|---|---|
toc | { depth: number; title: string; url?: string; [string]: any }[] | depth and title are required. |
style optional | string | bullet | number | menu |
maxDepth optional | number | string | How many levels should be rendered |
---
import { TOC } from "astro-toc";
const toc = [
{depth: 1, title: "Tours", url: /* optional*/},
{depth: 2, title: "Walking Tours"},
{depth: 3, title: "City Walking Tours"},
{depth: 3, title: "River Walking Tours"},
{depth: 2, title: "Boat Tours"},
{depth: 1, title: "Restaurants"},
{depth: 2, title: "Fine Dining"},
{depth: 2, title: "Gastropub"},
{depth: 2, title: "Fast Food"},
{depth: 1, title: "Hotels"},
];
---
<TOC toc={toc} />
When using a custom component it uses the <menu> element.
Unlike the classic render method title
isn't required and the payload will be passed to the component.
Property | Type | Description |
---|---|---|
toc | { depth: number; [string]: any }[] | depth is required. |
use | (props) => any | Astro component |
maxDepth optional | number | string | How many levels should be rendered |
---
import { TOC } from "astro-toc";
import MyComponent from "path/to/MyComponent.astro";
const toc = [
{depth: 1, title: "Tours"},
{depth: 2, title: "Walking Tours"},
{depth: 3, title: "City Walking Tours"},
{depth: 3, title: "River Walking Tours"},
{depth: 2, title: "Boat Tours"},
{depth: 1, title: "Restaurants"},
{depth: 2, title: "Fine Dining"},
{depth: 2, title: "Gastropub"},
{depth: 2, title: "Fast Food"},
{depth: 1, title: "Hotels"},
];
---
<TOC toc={toc} use={MyComponent} />
ISC
FAQs
Table of Contents (ToC) generator for Astro. Use custom components for interactivity.
The npm package astro-toc receives a total of 4 weekly downloads. As such, astro-toc popularity was classified as not popular.
We found that astro-toc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.