diff --git a/.gitignore b/.gitignore index c18dd8d..0e5b2ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ __pycache__/ +public/ diff --git a/public/index.html b/public/index.html deleted file mode 100644 index 1ed2aab..0000000 --- a/public/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - Why Frontend Development Sucks - - - -

Front-end Development is the Worst

-

- Look, front-end development is for script kiddies and soydevs who can't handle the real programming. I mean, - it's just a bunch of divs and spans, right? And css??? It's like, "Oh, I want this to be red, but not thaaaaat - red." What a joke. -

-

- Real programmers code, not silly markup languages. They code on Arch Linux, not macOS, and certainly not - Windows. They use Vim, not VS Code. They use C, not HTML. Come to the - backend, where the real programming - happens. -

- - diff --git a/public/styles.css b/public/styles.css deleted file mode 100644 index 69b0e5b..0000000 --- a/public/styles.css +++ /dev/null @@ -1,23 +0,0 @@ -body { - font-family: Arial, sans-serif; - line-height: 1.6; - margin: 0; - padding: 0; - background-color: #1f1f23; -} -body { - max-width: 600px; - margin: 0 auto; - padding: 20px; -} -h1 { - color: #ffffff; - margin-bottom: 20px; -} -p { - color: #999999; - margin-bottom: 20px; -} -a { - color: #6568ff; -} diff --git a/src/main.py b/src/main.py index c344dc5..a46107a 100644 --- a/src/main.py +++ b/src/main.py @@ -1,10 +1,29 @@ from textnode import TextNode,TextType from conversions import markdown_to_html_node +import shutil +import os + +def empty_public(): + dir_path = os.path.abspath("./public/") + if os.path.exists(dir_path): + shutil.rmtree(dir_path, ignore_errors=True) + os.mkdir(dir_path,mode=0o755) + +def copy_directory_recursive(src, dest): + # Ensure source directory exists + if not os.path.exists(src): + raise FileNotFoundError(f"Source directory '{src}' not found.") + + # Remove destination directory if it exists + if os.path.exists(dest): + shutil.rmtree(dest) + + # Recursively copy source directory to destination + shutil.copytree(src, dest) + def main(): - test_input = "This is *italics* and **bold**" - result = markdown_to_html_node(test_input).to_html() - print(f"Expected:

This is italics and bold

") - print(f"Got: {result}") + empty_public() + copy_directory_recursive("./static/","./public/") if __name__=="__main__": main() diff --git a/static/images/rivendell.png b/static/images/rivendell.png new file mode 100644 index 0000000..1fa5201 Binary files /dev/null and b/static/images/rivendell.png differ diff --git a/static/index.css b/static/index.css new file mode 100644 index 0000000..af144f7 --- /dev/null +++ b/static/index.css @@ -0,0 +1,93 @@ +body { + background-color: #0d1117; + color: #c9d1d9; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; + line-height: 1.5; + margin: 0; + padding: 20px; + max-width: 800px; + margin-left: auto; + margin-right: auto; +} + +b { + font-weight: 900; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + color: #58a6ff; + margin-top: 24px; + margin-bottom: 16px; +} + +h1 { + font-size: 2em; +} + +h2 { + font-size: 1.5em; +} + +h3 { + font-size: 1.17em; +} + +h4, +h5, +h6 { + font-size: 1em; +} + +a { + color: #58a6ff; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +ul, +ol { + padding-left: 20px; +} + +code { + background-color: #242424; + border-radius: 6px; + color: #d2a8ff; + padding: 0.2em 0.4em; + font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; +} + +pre code { + padding: 0; +} + +pre { + background-color: #242424; + border-radius: 6px; + padding: 0.2em 0.4em; +} + +blockquote { + background-color: #242424; + border-left: 4px solid #30363d; + padding-left: 2em; + margin-left: 0; + padding-top: 0.5em; + padding-bottom: 0.5em; + padding-right: 0.5em; + color: #8b949e; +} + +img { + max-width: 100%; + height: auto; + border-radius: 6px; +}