Instructions to use botezx/flagtldr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Grok
How to use botezx/flagtldr with Grok:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download scripts/package-chrome.py from botezx/flagtldr: direct link, hf CLI and curl.
- Browser
- Download file 2.15 kB
-
https://huggingface.co/botezx/flagtldr/resolve/main/scripts/package-chrome.py
- Command line
-
hf download hf://botezx/flagtldr/scripts/package-chrome.py
-
curl -L -o package-chrome.py https://huggingface.co/botezx/flagtldr/resolve/main/scripts/package-chrome.py
2.15 kB
| """Build the Chrome package: dist/flagtldr-<version>-chrome.zip (+ the same files unpacked in | |
| dist/flagtldr-<version>-chrome/ for "Load unpacked"). Only runtime files – no tests, fixtures, | |
| node_modules or dev tooling. The Chrome manifest drops Firefox-only keys (background.scripts, | |
| browser_specific_settings) so chrome://extensions shows no warnings. | |
| Usage: python3 scripts/package-chrome.py [--store] | |
| --store: store build (Edge Add-ons / Chrome Web Store) – no 127.0.0.1/localhost host permissions | |
| (local classifier / progrok stay unusable there); output dist/flagtldr-<version>-store.zip.""" | |
| import json, shutil, sys, zipfile | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| EXT = ROOT / "extension" | |
| INCLUDE = ["icons", "src", "vendor"] | |
| man = json.loads((EXT / "manifest.json").read_text()) | |
| ver = man["version"] | |
| man["background"] = {k: v for k, v in man["background"].items() if k != "scripts"} | |
| man.pop("browser_specific_settings", None) | |
| STORE = "--store" in sys.argv | |
| if STORE: | |
| man["host_permissions"] = [h for h in man["host_permissions"] if "127.0.0.1" not in h and "localhost" not in h] | |
| dist = ROOT / "dist" | |
| kind = "store" if STORE else "chrome" | |
| out_dir, out_zip = dist / f"flagtldr-{ver}-{kind}", dist / f"flagtldr-{ver}-{kind}.zip" | |
| shutil.rmtree(out_dir, ignore_errors=True) | |
| out_dir.mkdir(parents=True) | |
| files = sorted(p for d in INCLUDE for p in (EXT / d).rglob("*") if p.is_file()) | |
| for p in files: | |
| dst = out_dir / p.relative_to(EXT) | |
| dst.parent.mkdir(parents=True, exist_ok=True) | |
| shutil.copy2(p, dst) | |
| (out_dir / "manifest.json").write_text(json.dumps(man, ensure_ascii=False, indent=2) + "\n") | |
| out_zip.unlink(missing_ok=True) | |
| with zipfile.ZipFile(out_zip, "w", zipfile.ZIP_DEFLATED) as z: | |
| for p in sorted(out_dir.rglob("*")): | |
| if p.is_file(): | |
| zi = zipfile.ZipInfo(str(p.relative_to(out_dir)), date_time=(2026, 1, 1, 0, 0, 0)) | |
| zi.compress_type = zipfile.ZIP_DEFLATED | |
| z.writestr(zi, p.read_bytes()) | |
| print(f"{out_zip} ({out_zip.stat().st_size} bytes, {len(files) + 1} files)") | |
| print(f"{out_dir}/ (unpacked, for chrome://extensions → Load unpacked)") | |