From f7b007ebf485e016d2aa4682819dede22d5c61a1 Mon Sep 17 00:00:00 2001 From: Marc Foley Date: Thu, 15 Aug 2024 13:33:07 +0100 Subject: [PATCH] tags.html: add Open PR button --- .ci/tags.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.ci/tags.html b/.ci/tags.html index 424f0236f1..d9d6113ee5 100644 --- a/.ci/tags.html +++ b/.ci/tags.html @@ -13,8 +13,6 @@

Google Fonts Tagger

-

When you're done editing, please save the csv and open a pull request in the Google Fonts repo that replaces the families.csv file.

-
@@ -36,6 +34,7 @@
+
Edited
@@ -135,6 +134,19 @@ document.body.removeChild(a); URL.revokeObjectURL(url); }, + prCSV() { + this.Families = this.Families.filter((t) => t.Family !== ""); + console.log(this.Families); + let csv = Papa.unparse(this.Families, + { + columns: ["Family", "Group/Tag", "Weight"], + skipEmptyLines: true, + } + ); + alert("Tag data copied to clipboard. A github pull request page will open in a new tab. Please remove the old data and paste in the new."); + navigator.clipboard.writeText(csv); + window.open("https://github.com/google/fonts/edit/main/tags/all/families.csv") + }, loadCSV() { const csvFilePath = 'https://raw.githubusercontent.com/google/fonts/main/tags/all/families.csv'; // Update this path to your CSV file fetch(csvFilePath) -- 2.47.2