o
    Z$g                     @   s(  d dl Z d dlZd dlZd dlZd dlZd dlmZ dd Zedkre	ej
dkr2ed ed ee jej
d Zee jej
d	 Zee jej
d
 Ze sgedej
d  d ed e s{edej
d	  d ed ejddd eeeeZede d dS dS )    N)Pathc                 C   s  |d }|d }|j dd |j dd t| d}|s#td dS g }|D ]}|j}zvt|dd	d
}	|	 }
W d    n1 sCw   Y  d| d| d|
 dtd d	}t|| d dd	d
}|	| W d    n1 svw   Y  || d }|
 rt||| d  ||tdd| dd W q' ty } ztd| dt|  W Y d }~q'd }~ww ddd |D }d| dtd d}t|d dd	d
}|	| W d    n1 sw   Y  d }t|d! dd	d
}|	| W d    n	1 sw   Y  d"}t|d# dd	d
}|	| W d    n	1 s2w   Y  td$|  td%t|  t|S )&NtranscriptsdataT)exist_okz*.txtz.No transcript files found to generate website.r   rzutf-8)encodingz5<!DOCTYPE html>
<html>
<head>
    <title>Transcript: z</title>
    <link rel="stylesheet" href="../style.css">
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
    <div class="container">
        <header>
            <h1>Transcript: u   </h1>
            <a href="../index.html" class="back-link">← Back to List</a>
        </header>
        <main>
            <div class="transcript-content">
                <pre>zW</pre>
            </div>
        </main>
        <footer>
            <p>Generated on z%Y-%m-%d %H:%M:%SzZ</p>
        </footer>
    </div>
    <script src="../script.js"></script>
</body>
</html>z.htmlwz.jsonz%Y-%m-%dztranscripts/)namedatepathzError processing z: 
c              	   S   s0   g | ]}d |d  d|d  d|d  dqS )z<li><a href="r   z">r	   z</a> <span class="date">r
   z</span></li> ).0tr   r   2/home/garg/annotate-voice/static_site_generator.py
<listcomp>Q   s    "z(generate_static_site.<locals>.<listcomp>a  <!DOCTYPE html>
<html>
<head>
    <title>Voice Transcripts</title>
    <link rel="stylesheet" href="style.css">
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
    <div class="container">
        <header>
            <h1>Voice Transcripts</h1>
        </header>
        <main>
            <div class="search-container">
                <input type="text" id="searchInput" placeholder="Search transcripts...">
            </div>
            <ul class="transcript-list">
                zQ
            </ul>
        </main>
        <footer>
            <p>Last updated: zW</p>
        </footer>
    </div>
    <script src="script.js"></script>
</body>
</html>z
index.htmla4  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

h1 {
    margin-top: 0;
    color: #2c3e50;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #3498db;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

.transcript-list {
    list-style: none;
    padding: 0;
}

.transcript-list li {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.transcript-list li:hover {
    background-color: #f5f5f5;
}

.transcript-list a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.transcript-list a:hover {
    text-decoration: underline;
}

.date {
    font-size: 0.8em;
    color: #7f8c8d;
    float: right;
}

pre {
    white-space: pre-wrap;
    background: #f8f8f8;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #eee;
}

.search-container {
    margin-bottom: 20px;
}

#searchInput {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

footer {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 10px;
    font-size: 0.9em;
    color: #7f8c8d;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
}z	style.cssa  document.addEventListener('DOMContentLoaded', function() {
    // Search functionality
    const searchInput = document.getElementById('searchInput');
    const transcriptItems = document.querySelectorAll('.transcript-list li');
    
    if (searchInput) {
        searchInput.addEventListener('input', function() {
            const searchTerm = this.value.toLowerCase();
            
            transcriptItems.forEach(item => {
                const text = item.textContent.toLowerCase();
                if (text.includes(searchTerm)) {
                    item.style.display = '';
                } else {
                    item.style.display = 'none';
                }
            });
        });
    }
});z	script.jszStatic website generated in zTotal transcripts: )mkdirsortedglobprintstemopenreadtimestrftimewriteexistsshutilcopyappend	Exceptionstrjoinlen)readable_pathoutput_pathweb_pathtranscripts_path	data_path	txt_filestranscript_listtxt_filer	   srccontenttranscript_htmlf	json_pathetranscripts_html
index_htmlcssjsr   r   r   generate_static_site	   sz   


$
fr6   __main__   zUUsage: python static_site_generator.py [readable_folder] [output_folder] [web_folder]         zError: Readable folder 'z' does not existzError: Output folder 'T)parentsr   zGenerated static site with z transcripts)ossysjsonr   r   pathlibr   r6   __name__r#   argvr   exitr   
expanduserr$   r%   r&   r   r   countr   r   r   r   <module>   s2    u


