/** * edit_and_feedback.js * * Enhances MkDocs Material docs pages by: * * 1. Adding a "Question? Give us feedback" link * below the "Edit" button. * * - The link opens a GitHub issue with a template, * auto-filled with the current page URL and path. * * 2. Ensuring the edit button opens in a new tab * with target="_blank" and rel="noopener". */ document.addEventListener("DOMContentLoaded", function () { const url = window.location.href; const page = document.body.dataset.mdUrl || location.pathname; const feedbackLink = document.createElement("a"); feedbackLink.href = `https://github.com/vllm-project/vllm/issues/new?template=100-documentation.yml&title=${encodeURIComponent( `[Docs] Feedback for \`${page}\`` )}&body=${encodeURIComponent(`šŸ“„ **Reference:**\n${url}\n\nšŸ“ **Feedback:**\n_Your response_`)}`; feedbackLink.target = "_blank"; feedbackLink.rel = "noopener"; feedbackLink.title = "Provide feedback"; feedbackLink.className = "md-content__button"; feedbackLink.innerHTML = ` `; const editButton = document.querySelector('.md-content__button[href*="edit"]'); if (editButton && editButton.parentNode) { editButton.insertAdjacentElement("beforebegin", feedbackLink); editButton.setAttribute("target", "_blank"); editButton.setAttribute("rel", "noopener"); } });