Skip to content

Commit

Permalink
readme changes
Browse files Browse the repository at this point in the history
  • Loading branch information
404salad committed Oct 30, 2024
1 parent b0bbfd1 commit aa5fef7
Show file tree
Hide file tree
Showing 18 changed files with 80 additions and 27 deletions.
24 changes: 24 additions & 0 deletions content/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
this is a blog and a static site generator
simply converts a folder of markdown files to a blog webpage

todos/bugs
- no testing yet
- Does not check for directory from which the program is run, leading to bugs (to fix this dont hardcode directory names)
- using templating for generating html intead of using raw strings for correctness
- adding color themes or custom theming in the user config
- too many unwraps
- hacky solution to check if running for base directory, set a base directory on each run
- add overide for filename to not be the name of the article
- sort it chronologically, use flags to add a new article eg- pond add "moon river" (maybe)
- non markdown files in the content directory need to be ignored
- refactoring utils dir into logical .rs files?

some ideas for usabilty and performance
- should probably add a file mode to watch a specific file for changes and then update it
- maybe i should watch all the files for changes and then update specifi file but then again idk how it iwll handle file name changes
- if the folder dretects change then we can rerender the entire thing, otherwise we can partially update the articles that are being watched specifically??
- former overrides the latter

state
- maintaing an internal state could be useful in some cases but using the content folder as the single source of truth is very powerful
- FEATURE IDEA -> a period '.' in front of the filename for drafts or hidden articles
Binary file added dist/FiraMono-Regular.ttf
Binary file not shown.
1 change: 0 additions & 1 deletion dist/articles/Cronjobs.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<html lang="en">
<head>
<meta charset="UTF-8">

<link rel="stylesheet" href="../style.css">
<title>Cronjobs</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion dist/articles/Debugging C++ Programs with GDB.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<html lang="en">
<head>
<meta charset="UTF-8">

<link rel="stylesheet" href="../style.css">
<title>Debugging C++ Programs with GDB</title>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<html lang="en">
<head>
<meta charset="UTF-8">

<link rel="stylesheet" href="../style.css">
<title>Every Programmer Should Watch Conference Talks on YouTube</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion dist/articles/Makefiles:).html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<html lang="en">
<head>
<meta charset="UTF-8">

<link rel="stylesheet" href="../style.css">
<title>Makefiles:)</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion dist/articles/On Logging.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<html lang="en">
<head>
<meta charset="UTF-8">

<link rel="stylesheet" href="../style.css">
<title>On Logging</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion dist/articles/file_for_testing2.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<html lang="en">
<head>
<meta charset="UTF-8">

<link rel="stylesheet" href="../style.css">
<title>file_for_testing2</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion dist/articles/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<html lang="en">
<head>
<meta charset="UTF-8">

<link rel="stylesheet" href="../style.css">
<title>image</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion dist/articles/image2.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<html lang="en">
<head>
<meta charset="UTF-8">

<link rel="stylesheet" href="../style.css">
<title>image2</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion dist/articles/moo.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<html lang="en">
<head>
<meta charset="UTF-8">

<link rel="stylesheet" href="../style.css">
<title>moo</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion dist/articles/new_blog.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<html lang="en">
<head>
<meta charset="UTF-8">

<link rel="stylesheet" href="../style.css">
<title>new_blog</title>
</head>
Expand Down
42 changes: 42 additions & 0 deletions dist/articles/readme.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../style.css">
<title>readme</title>
</head>
<body class="container">
<a href='../index.html'>home</a>
<h1> readme </h1>
<hr>
<p>this is a blog and a static site generator<br />
simply converts a folder of markdown files to a blog webpage</p>
<p>todos/bugs</p>
<ul>
<li>no testing yet</li>
<li>Does not check for directory from which the program is run, leading to bugs (to fix this dont hardcode directory names)</li>
<li>using templating for generating html intead of using raw strings for correctness</li>
<li>adding color themes or custom theming in the user config</li>
<li>too many unwraps</li>
<li>hacky solution to check if running for base directory, set a base directory on each run</li>
<li>add overide for filename to not be the name of the article</li>
<li>sort it chronologically, use flags to add a new article eg- pond add “moon river” (maybe)</li>
<li>non markdown files in the content directory need to be ignored</li>
<li>refactoring utils dir into logical .rs files?</li>
</ul>
<p>some ideas for usabilty and performance</p>
<ul>
<li>should probably add a file mode to watch a specific file for changes and then update it</li>
<li>maybe i should watch all the files for changes and then update specifi file but then again idk how it iwll handle file name changes </li>
<li>if the folder dretects change then we can rerender the entire thing, otherwise we can partially update the articles that are being watched specifically??</li>
<li>former overrides the latter</li>
</ul>
<p>state</p>
<ul>
<li>maintaing an internal state could be useful in some cases but using the content folder as the single source of truth is very powerful</li>
<li>FEATURE IDEA -&gt; a period ‘.’ in front of the filename for drafts or hidden articles</li>
</ul>

</body>
</html>
2 changes: 2 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ <h6>sahil
<a href="articles/file_for_testing2.html"> file_for_testing2 </a>
</article><article>
<a href="articles/On Logging.html"> On Logging </a>
</article><article>
<a href="articles/readme.html"> readme </a>
</article><article>
<a href="articles/new_blog.html"> new_blog </a>
</article><article>
Expand Down
18 changes: 7 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@ simply converts a folder of markdown files to a blog webpage

todos/bugs
- no testing yet
- Does not check for directory from which the program is run, leading to bugs (to fix this dont hardcode directory names)
- using templating for generating html intead of using raw strings for correctness
- using templating for generating html intead of using raw strings for correctness
(maybe creating my own pythonic html templating :D)
- adding color themes or custom theming in the user config
- too many unwraps
- hacky solution to check if running for base directory, set a base directory on each run
- add overide for filename to not be the name of the article
- sort it chronologically, use flags to add a new article eg- pond add "moon river" (maybe)
- BIGGEST ISSUE IMO sorting dates -> sort it chronologically, use flags to add a new article eg- pond add "moon river" (maybe)
can think of many solutions like adding timestamp to the filename but that will pollute the filename,
maybe can read metadata for when the file was created?(could run into crossplateform issues but is the simplest)
- non markdown files in the content directory need to be ignored
- refactoring utils dir into logical .rs files?

some ideas for usabilty and performance
- should probably add a file mode to watch a specific file for changes and then update it
- maybe i should watch all the files for changes and then update specifi file but then again idk how it iwll handle file name changes
- if the folder dretects change then we can rerender the entire thing, otherwise we can partially update the articles that are being watched specifically??
- former overrides the latter

state
state?
- maintaing an internal state could be useful in some cases but using the content folder as the single source of truth is very powerful
- FEATURE IDEA -> a period '.' in front of the filename for drafts or hidden articles

6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ fn main() {
);
let _ = term.write_line(" A simple cli tool to convert markdown to blog");

if utils::running_from_project_root() {
println!("running from base directory 🗸");
if utils::has_content_dir() {
println!("content/ found");
} else {
println!("kindly run pond from the base directory");
println!("kindly make a content/ directory");
return;
}

Expand Down
1 change: 0 additions & 1 deletion src/parse_one_article.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ fn wrap_html(markdown_output: &str, article: &str, _user_config: &config::UserCo
<html lang=\"en\">
<head>
<meta charset=\"UTF-8\">
<link rel=\"stylesheet\" href=\"../style.css\">
<title>{article}</title>
</head>
Expand Down
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ pub fn no_folder_level_changes(latest_change_time: &mut SystemTime) -> bool {
}
}

pub fn running_from_project_root() -> bool {
pub fn has_content_dir() -> bool {
if let Ok(current_directory) = env::current_dir() {
current_directory.join("Cargo.toml").exists()
current_directory.join("content").exists()
} else {
false
}
Expand Down

0 comments on commit aa5fef7

Please sign in to comment.