added static_copy
This commit is contained in:
parent
105f1eee29
commit
4a07aec860
6 changed files with 117 additions and 47 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
public/
|
||||||
|
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Why Frontend Development Sucks</title>
|
|
||||||
<link rel="stylesheet" href="styles.css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Front-end Development is the Worst</h1>
|
|
||||||
<p>
|
|
||||||
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.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
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
|
|
||||||
<a href="https://www.boot.dev">backend</a>, where the real programming
|
|
||||||
happens.
|
|
||||||
</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
@ -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;
|
|
||||||
}
|
|
||||||
27
src/main.py
27
src/main.py
|
|
@ -1,10 +1,29 @@
|
||||||
from textnode import TextNode,TextType
|
from textnode import TextNode,TextType
|
||||||
from conversions import markdown_to_html_node
|
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():
|
def main():
|
||||||
test_input = "This is *italics* and **bold**"
|
empty_public()
|
||||||
result = markdown_to_html_node(test_input).to_html()
|
copy_directory_recursive("./static/","./public/")
|
||||||
print(f"Expected: <div><p>This is <em>italics</em> and <strong>bold</strong></p></div>")
|
|
||||||
print(f"Got: {result}")
|
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
main()
|
main()
|
||||||
|
|
|
||||||
BIN
static/images/rivendell.png
Normal file
BIN
static/images/rivendell.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 MiB |
93
static/index.css
Normal file
93
static/index.css
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue