.gitignore | ||
LICENSE | ||
README.md |
c-staticsite-generator (WIP NOT COMPLETE)
Abstract
In this project we attempt to write a fast and minimal static site generator. The generator will accept plaintext markdown and produce HTML as it's artifact(s). Users may extend this software in automated pipelines to deploy blogs, marketing sites, or online documentation. This project is heavily inspired by by suckless.org and 512kb.club
Requirements
The author(s) assumes the reader posesses a C compiler, git client, text editor, and working knowledge of C, HTML, and CSS.
Tooling
- Modern C compiler (
gcc
andtcc
work well) - Relevant C libraries
stdio.h
string.h
stdbool.h
stdlib.h
Usage
- Install dependencies
- Clone this repository
- Record any prose you want using
Markdown
- Draft a CSS file to your taste
- Build the binary
tcc -Wall -o ssg.exe markdown_to_html.c
- Call the binary
./ssg.exe input.md output.html
- View the output in any web browser
- Return to step 3 until you are satisfied
Testing and Debugging
A sample Markdown
and CSS file is available for testing the generator. To debug the generator, we recommend enabling debug and warning flags on your compiler.
"Bugs"
Markdown
spec is not fully supported (tables, strikethrough, etc..)- Styling is done manually via CSS
- No "Table of Contents" or "Site Map" support (yet)
Attribution
Warning
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
TL;DR: Not my problem
License
The GPL V2
license applies to this project. All copyrights belong to their respective copyright holders and all trademarks belong to their trademark holders.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.)