--- id: mkdocs-open-in-new-tab version: "1.0.8" license: MIT license_treatment: permissive maintenance: dormant --- # mkdocs-open-in-new-tab — MkDocs plugin to open outgoing links and PDFs in new tab. License: permissive · Maintenance: dormant · Downloads: 197.7K/mo ## What it is and what it does This plugin modifies the behavior of links in a MkDocs-generated site by injecting JavaScript that detects external links and files, then forces them to open in a new tab. It distinguishes between external URLs (by comparing hostname) and downloadable file types (PDF, Office documents, archives) and applies the `target="_blank"` and `rel="noopener"` attributes to them. Relative links within your documentation remain unaffected and open in the same tab. The plugin is designed to improve user experience and accessibility by preventing external navigation from losing the reader's place in your documentation. It works by hooking into MkDocs' page context and injecting a small JavaScript file into every page. It includes optional styling to add a visual indicator (↗ arrow) next to links that will open in a new tab, and it explicitly handles compatibility with mkdocs-material's instant loading feature. Use it for: - Documentation sites that link to external resources and want to keep readers on the site. - Adding visual indicators to external links for better UX and accessibility. - Ensuring PDF downloads and file links open in new tabs without modifying Markdown. - Sites using mkdocs-material that need consistent link behavior across instant-loaded pages. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A MkDocs plugin that injects JavaScript to automatically open external links and downloadable files (PDFs, documents, archives) in a new browser tab while keeping relative links in the same tab. Yes, if you maintain a MkDocs site and want external links to open in new tabs without manual Markdown edits. The plugin is stable, has no security vulnerabilities, and adds minimal overhead. Dormant maintenance is acceptable here since the feature is simple and unlikely to break with MkDocs updates; however, verify compatibility with your specific MkDocs version and theme before relying on it for production. ## Install pip install mkdocs-open-in-new-tab uv add mkdocs-open-in-new-tab poetry add mkdocs-open-in-new-tab ## Installing mkdocs-open-in-new-tab Before you install: Low friction: pure Python wheel with only mkdocs as a runtime dependency. Maintenance is dormant—last release was 634 days ago, though the repository remains active with a recent commit on 2024-11-18. Suitable for stable, feature-complete use cases. License in practice: MIT license (permissive) means you can use, modify, and distribute this plugin freely in commercial and private projects with minimal restrictions. Quickstart: pip install mkdocs-open-in-new-tab Then add to mkdocs.yml: plugins: - open-in-new-tab Optionally configure: plugins: - open-in-new-tab: add_icon: true Verify before relying: - Whether the plugin works correctly with all mkdocs-material versions, especially its instant loading feature. - Performance impact when applied to sites with thousands of links. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 197.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags mkdocs external links new tab, mkdocs plugin open links new window, mkdocs pdf new tab, mkdocs outgoing links target blank, mkdocs link behavior plugin, mkdocs accessibility new tab links, mkdocs-plugin, link-behavior [View on SkillFed](https://skillfed.io/packages/mkdocs-open-in-new-tab) · [View on PyPI](https://pypi.org/project/mkdocs-open-in-new-tab/)