diff --git a/PyPost.py b/PyPost.py index 16f0579..e8d3f65 100644 --- a/PyPost.py +++ b/PyPost.py @@ -122,7 +122,10 @@ def render_markdown(md_path: Path): {title} - + +
@@ -144,6 +147,8 @@ def render_markdown(md_path: Path): Hash 1 (UTF-8):{base64.b64encode(hash1.encode("utf-8")).decode("utf-8")}
Hash2 Hash 2 (Windows-1252):{base64.b64encode(hash2.encode("windows-1252")).decode("windows-1252")}
+ Hash2 + Download as Markdown """ @@ -162,11 +167,11 @@ def render_markdown(md_path: Path): # Create parent directories if needed out_path.parent.mkdir(parents=True, exist_ok=True) - if obfuscate: - out_path.write_text(obfuscated_html, encoding="utf-8") - else: - out_path.write_text(clean_html, encoding="utf-8") - +# if obfuscate: +# out_path.write_text(obfuscated_html, encoding="utf-8") +# else: +# out_path.write_text(clean_html, encoding="utf-8") + out_path.write_text(clean_html, encoding="utf-8") Logger.log_debug(f"Rendered: {md_path} -> {out_path}") def remove_html(md_path: Path): @@ -184,7 +189,6 @@ def initial_scan(markdown_dir: Path): def build_rust_parser() -> bool: - """Attempt to build the Rust parser using cargo.""" fastmd_dir = ROOT / "fastmd" if not fastmd_dir.exists(): @@ -269,34 +273,6 @@ if __name__ == "__main__": else: Logger.log_warning("Using Python parser for all files") - import argparse - - parser = argparse.ArgumentParser(description="Monitor markdown directory and convert to HTML with dynamic parser selection.") - - # This stores True when passed, but means "no obfuscation" - parser.add_argument( - "--no-obfuscate", - action="store_false", - help="Disable HTML obfuscation." - ) - - parser.add_argument( - "--rust-threshold", - type=int, - default=500, - help=f"Line count threshold for using Rust parser (default: {RUST_PARSER_THRESHOLD})" - ) - - args = parser.parse_args() - - # Invert it to get the obfuscate flag - obfuscate = not args.no_obfuscate - - # Update threshold if specified - RUST_PARSER_THRESHOLD = args.rust_threshold - - Logger.log_obfuscation_info(f"Obfuscation is {obfuscate}",obfuscate) - initial_scan(MARKDOWN_DIR) event_handler = Handler() observer = Observer() diff --git a/css/icons/save.webp b/css/icons/save.webp new file mode 100644 index 0000000..4b9d4e4 Binary files /dev/null and b/css/icons/save.webp differ diff --git a/css/icons/search.png b/css/icons/search.png deleted file mode 100644 index dfad59e..0000000 Binary files a/css/icons/search.png and /dev/null differ diff --git a/css/icons/search.webp b/css/icons/search.webp new file mode 100644 index 0000000..852e968 Binary files /dev/null and b/css/icons/search.webp differ diff --git a/html/base/index.html b/html/base/index.html index 6398cdf..d961725 100644 --- a/html/base/index.html +++ b/html/base/index.html @@ -7,14 +7,18 @@ h1 { color: #333; } li { list-style: none; background: url("../../css/icons/item.webp") no-repeat left center; background-size: 15px 20px; padding-left: 25px; transition: font-size 0.5s cubic-bezier(0.075, 0.82, 0.165, 1); padding-bottom: 5px; } li:hover { font-size: larger; } - #available { padding-left: 40px; margin-bottom: 0.1em;} - ul { padding-left: 100px; margin-top: 0.2em;} + #available { padding-left: 40px; margin-bottom: 0.1em;} + ul { padding-left: 100px; margin-top: 0.2em;} #nojs { display: inline-block;color: red;transition: transform 0.7s cubic-bezier(0.215, 0.610, 0.355, 1); } /*#nojs:hover { transform: skewX(-12deg);}*/ #nonenormalul { list-style: disc inside; margin: 1em 0; padding-left: 40px; background: none; } #nonenormalul li { list-style: inherit; margin: 0; padding: 0; background: none; transition: font-size 0.5s cubic-bezier(0.075, 0.82, 0.165, 1); } #nonenormalul li:hover { font-size: larger; } + @@ -32,77 +36,18 @@

-

Available pages:

- + - - const items = ul.querySelectorAll('li'); - items.forEach(li => { - if (li.textContent.toLowerCase().includes(query)) { - li.style.display = 'list-item'; - } else { - li.style.display = 'none'; - } - }); - } - - // Create search box and insert before the available pages paragraph - window.addEventListener('DOMContentLoaded', function() { - const searchDiv = document.createElement('div'); - searchDiv.style.marginBottom = '16px'; - searchDiv.style.paddingLeft = '19px'; - searchDiv.innerHTML = ` - - `; - const available = document.getElementById('available'); - available.parentNode.insertBefore(searchDiv, available); - - const searchbox = document.getElementById('searchbox'); - if (searchbox) { - searchbox.title = "Search for pages"; - searchbox.style.fontStyle = "italic"; - } - - document.getElementById('searchbox').addEventListener('input', search_ul_items); - }); - - -