Skip to content

Commit

Permalink
script.sh, src/ and docs/
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandremcosta committed Feb 13, 2023
0 parents commit 0abdfdf
Show file tree
Hide file tree
Showing 56 changed files with 2,859 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Vim
*.swp

# Devenv
devenv*
.devenv*
devenv.local.nix
.envrc

# OSX
.DS_Store
**/.DS_Store
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Markdown-to-HTML Converter

This script converts all Markdown files from a input directory to HTML and applies a `layout.html` file.

Additionally:

1. replaces `{{ partial_filename }}` in the generated output by the contents the partial file
2. non-markdown files in input directory are copied to output directory
3. supports subdirectories

## Usage

```shell
sh script.sh layout.html input_dir output_dir
```

### Parameters
- **layout.html**: the layout file that will be applied to the generated HTML files.
- **input_dir**: the directory that contains the markdown files that need to be converted.
- **output_dir**: the directory where the generated HTML files will be saved.

### Requirements
The script requires pandoc to be installed on the system.

### Examples

```
sh script.sh layout.html ~/markdown-files ~/html-files
```

This command will convert all Markdown files in the ~/markdown-files directory and any subdirectories to HTML files, while applying the layout.html template, and will place the generated files in ~/html-files directory.

## Contribution

If you find a bug or want to suggest a feature, please open an issue on GitHub.
If you want to contribute to the code, please submit a pull request.

## Note

- This script was tested on MacOS 12.5.1 but should work on any system with minimal adjustments
- It was developed mostly by ChatGPT since I suck at bash scripting in an astronomic level
- ChatGPT also wrote this file
- Read [this blog post](http://alexandremcosta.github.io/chat-gpt-site-generator.html) for a bit of history
Binary file added docs/assets/avatar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/fw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/gh-pages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/gpt01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/gpt02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/puc.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/ruby.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/slack.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/blog-nav.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<h3>My Notes</h3>

<ul>
<li><a href="chat-gpt-site-generator.html">How was this site built by Chat GPT?</a></li>
<li><a href="erlang-trace-from-elixir.html">Using :erlang.trace/3 in Elixir</a></li>
<li><a href="shorter-kubernetes-commands.html">Functions to shorten Kubernetes commands</a></li>
<li><a href="run-test-under-cursor-in-vim.html">Run test in Vim without extensions</a></li>
<li><a href="toggle-fullscreen-vim-split.html">Toggle Vim split full screen without extensions</a></li>
</ul>
69 changes: 69 additions & 0 deletions docs/blog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script async src="//static.getclicky.com/101395598.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<title>Alex’s Blog</title>
<style>
</style>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<header>
<nav class="navbar navbar-expand navbar-light">
<div class="container">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/resume.html">Resume</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/blog.html">Blog</a>
</li>
</ul>
</div>
</nav>
</header>
<main class="container py-3">
<div class="row">
<div class="col col-xl-8 offset-xl-2">
<p>Those are some personal notes. They are recent, so don’t expect a lot
but enjoy :)</p>
<p><h3>My Notes</h3>

<ul>
<li><a href="chat-gpt-site-generator.html">How was this site built by Chat GPT?</a></li>
<li><a href="erlang-trace-from-elixir.html">Using :erlang.trace/3 in Elixir</a></li>
<li><a href="shorter-kubernetes-commands.html">Functions to shorten Kubernetes commands</a></li>
<li><a href="run-test-under-cursor-in-vim.html">Run test in Vim without extensions</a></li>
<li><a href="toggle-fullscreen-vim-split.html">Toggle Vim split full screen without extensions</a></li>
</ul></p>
<p>Also some personal videos using our <a
href="https://firework.com">Firework.com</a> product:</p>
<script async type="text/javascript" src="//asset.fwcdn3.com/js/embed-feed.js"></script>
<p><fw-embed-feed
channel="alexandre"
playlist="oPKwR5"
mode="row"
open_in="default"
max_videos="0"
placement="middle"
player_placement="bottom-right"
></fw-embed-feed></p>
</div>
</div>
</main>
<footer class="py-4 text-center row">
<div class="col-8 offset-2 font-small">
<small>
Website generated by a <a href="chat-gpt-site-generator.html">script</a> created with the help of <a href="https://openai.com/api/gpt/">ChatGPT</a> from <a href="https://openai.com/">OpenAI</a>.<br>
Licensed under the <a href="https://opensource.org/licenses/MIT">MIT license</a>.
</small>
</div>
</footer>
</body>
</html>
21 changes: 21 additions & 0 deletions docs/blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Alex's Blog
---
Those are some personal notes. They are recent, so don't expect a lot but enjoy :)

{{ blog-nav.html }}

Also some personal videos using our [Firework.com](https://firework.com) product:

<script async type="text/javascript" src="//asset.fwcdn3.com/js/embed-feed.js"></script>

<fw-embed-feed
channel="alexandre"
playlist="oPKwR5"
mode="row"
open_in="default"
max_videos="0"
placement="middle"
player_placement="bottom-right"
></fw-embed-feed>
Loading

0 comments on commit 0abdfdf

Please sign in to comment.