File size: 7,018 Bytes
69fac21
 
 
 
 
32389b6
69fac21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32389b6
69fac21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Hugging Face or GitHub Repo to Plain Text Converter | Convert Code and ML Repositories to Text</title>
    <meta name="description" content="Convert GitHub and Hugging Face repositories to plain text files easily. Our tool helps you transform code into a single formatted text file for better readability and analysis.">
    <meta name="keywords" content="GitHub, Hugging Face, code converter, plain text, repository, code analysis">
    <meta name="author" content="abinthomasonline">
    <link rel="canonical" href="https://repo2txt.simplebasedomain.com/">
    <meta property="og:title" content="Repo to Plain Text Converter">
    <meta property="og:description" content="Convert GitHub and Hugging Face repositories to plain text files easily. Transform code into a single formatted text file.">
    <meta property="og:url" content="https://repo2txt.simplebasedomain.com/">
    <meta property="og:type" content="website">
    <link rel="icon" href="/favicon.ico" type="image/x-icon">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="js/lucide.min.js"></script>
    <!-- Google tag (gtag.js) -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-CYF86LN5WM"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());

        gtag('config', 'G-CYF86LN5WM');
    </script>
    <script src="js/jszip.min.js"></script>
    <script async src="https://unpkg.com/gpt-tokenizer"></script>
</head>
<body class="bg-gray-100 min-h-screen p-4 md:p-8 text-gray-600">
    <div class="max-w-4xl mx-auto bg-white rounded-lg shadow-md p-6 relative">
        <a href="https://github.com/abinthomasonline/repo2txt" target="_blank" class="absolute top-2 right-2">
            <i data-lucide="github" class="w-8 h-8 text-gray-600 hover:text-gray-800"></i>
        </a>
        <h1 class="text-3xl font-bold mb-2 text-center text-gray-600">Hugging Face or GitHub Repo to Plain Text</h1>
        <p class="text-lg text-center text-gray-500 mb-6">Convert Code in GitHub or Hugging Face to a Single Formatted Text File</p>
        <form id="repoForm" class="space-y-4">
            <div>
                <label for="repoUrl" class="block text-sm font-medium text-gray-600">Repo URL (GitHub or Hugging Face):</label>
                <input type="text" id="repoUrl" name="repoUrl" required class="mt-1 block w-full rounded-md border border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 h-10 px-2" placeholder="e.g., https://github.com/owner/repo or https://huggingface.co/owner/repo">
            </div>
            <div>
                <label for="accessToken" class="block text-sm font-medium text-gray-600 flex items-center">
                    Access Token (optional - for private repos & higher rate limits):
                    <button type="button" id="showMoreInfo" class="ml-2 text-blue-500 hover:text-blue-700">
                        <i data-lucide="info" class="w-4 h-4"></i>
                    </button>
                </label>
                <div id="tokenInfo" class="hidden mt-2">
                    <p class="text-sm text-gray-500">[This code runs in your browser. Your token will be saved locally for convenience.]</p>
                    <p class="mt-1"><a href="https://github.com/settings/tokens/new?description=repo2file&scopes=repo" target="_blank" class="text-sm text-gray-500 hover:text-gray-700"><i data-lucide="external-link" class="w-5 h-5 inline-block"></i> Get a GitHub token</a></p>
                    <p class="mt-1"><a href="https://huggingface.co/settings/tokens" target="_blank" class="text-sm text-gray-500 hover:text-gray-700"><i data-lucide="external-link" class="w-5 h-5 inline-block"></i> Get a Hugging Face token</a></p>
                </div>
                <input type="text" id="accessToken" name="accessToken" class="mt-1 block w-full rounded-md border border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 h-10 px-2">
            </div>
            <div>
                <a href="/local.html" class="text-blue-500 hover:text-blue-700 underline">
                    Convert From Local Directory Instead
                </a>
            </div>
            <button type="submit" class="bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline flex items-center justify-center">
                <i data-lucide="folder-search" class="w-5 h-5 mr-2"></i>
                Fetch Directory Structure
            </button>
        </form>
        <div id="extentionCheckboxes"></div>
        <div id="directoryStructure" class="mt-6"></div>
        <div class="mt-4 flex space-x-4">
            <button id="generateTextButton" class="flex-1 bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline hidden flex items-center justify-center">
                <i data-lucide="file-text" class="w-5 h-5 mr-2"></i>
                Generate Text File
            </button>
            <button id="downloadZipButton" class="flex-1 bg-purple-500 hover:bg-purple-600 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline hidden flex items-center justify-center">
                <i data-lucide="download" class="w-5 h-5 mr-2"></i>
                Download Zip
            </button>
        </div>
        <div id="tokenCount" class="mt-4 text-sm text-gray-500"></div>
        <textarea id="outputText" rows="20" class="mt-4 w-full p-2 border rounded-md font-mono" readonly></textarea>
        <div class="mt-4 flex space-x-4">
            <button id="copyButton" class="flex-1 bg-indigo-500 hover:bg-indigo-600 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline hidden flex items-center justify-center">
                <i data-lucide="copy" class="w-5 h-5 mr-2"></i>
                Copy to Clipboard
            </button>
            <button id="downloadButton" class="flex-1 bg-purple-500 hover:bg-purple-600 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline hidden flex items-center justify-center">
                <i data-lucide="download" class="w-5 h-5 mr-2"></i>
                Download Text File
            </button>
        </div>
    </div>
    <footer class="mt-8 text-center text-sm text-gray-500">
        <p>If you encounter any errors, please email <a href="mailto:abinthomasonline@gmail.com" class="text-blue-500 hover:text-blue-700">abinthomasonline@gmail.com</a> or <a href="https://github.com/abinthomasonline/repo2txt/issues" target="_blank" class="text-blue-500 hover:text-blue-700">raise a GitHub issue</a>.</p>
    </footer>
    <script type="module" src="js/index.js"></script>
</body>
</html>