Compare commits
5 commits
cd4911519a
...
2cc0fa67c5
Author | SHA1 | Date | |
---|---|---|---|
2cc0fa67c5 | |||
da4c0b6173 | |||
947a5ea044 | |||
864b6dafe7 | |||
12814571cf |
3 changed files with 21 additions and 17 deletions
16
README.md
16
README.md
|
@ -4,11 +4,15 @@ Static Website Generator (swg) is a lightweight utility that does exactly
|
|||
what's written on the tin. This utility aims to be a simple yet painless
|
||||
program to automate the boring work of static website development.
|
||||
|
||||
This utility was created originally for the development of version 3 of the
|
||||
luca0N! website.
|
||||
This utility was created originally for the [development of version 3 of the
|
||||
luca0N! website](https://git.luca0n.com/luca0N/luca0N-website).
|
||||
|
||||
Static Website Generator is very limited and is not intended for anything other
|
||||
than simple static websites. Some features are still in the works.
|
||||
Static Website Generator is currently under development, and production usage
|
||||
is discouraged. Expect bugs and bad unoptimized performance.
|
||||
|
||||
## License and copyright notice
|
||||
|
||||
Copyright © 2022–2023 luca0N!
|
||||
|
||||
This is free software. You are allowed to modify, redistribute and distribute
|
||||
modified versions of this software under the terms of the GNU Lesser General
|
||||
|
@ -18,7 +22,3 @@ Inc. [Read the LICENSE file for further information.](LICENSE)
|
|||
## Documentation
|
||||
|
||||
Coming soon!
|
||||
|
||||
<hr/>
|
||||
|
||||
Copyright © 2022–2023 luca0N!
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2022 luca0N!
|
||||
* Copyright (C) 2022-2023 luca0N!
|
||||
*
|
||||
* This file is part of Static Website Generator (swg).
|
||||
*
|
||||
|
@ -25,7 +25,7 @@
|
|||
#define PROGRAM_VERSION 1
|
||||
#define PROGRAM_VERSION_NAME "0.1-dev"
|
||||
#define PROGRAM_COPYRIGHT "luca0N!"
|
||||
#define PROGRAM_COPYRIGHT_YEARS "2022"
|
||||
#define PROGRAM_COPYRIGHT_YEARS "2022-2023"
|
||||
|
||||
#define RETURN_SUCCESSFUL 0
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2022 luca0N!
|
||||
* Copyright (C) 2022-2023 luca0N!
|
||||
*
|
||||
* This file is part of Static Website Generator (swg).
|
||||
*
|
||||
|
@ -102,9 +102,10 @@ std::string make_html(std::filesystem::path const &path) {
|
|||
|
||||
// End ul tag if it's active and a new line doesn't contain an
|
||||
// item.
|
||||
if (tag_ul && newline && buf[0] != '-') {
|
||||
if (tag_ul && newline && buf[0] != '-' && buf[0] == '\n') {
|
||||
tag_ul = false;
|
||||
html += "</ul>";
|
||||
tag_li = false;
|
||||
html += "</li></ul>";
|
||||
}
|
||||
|
||||
// Read character by character
|
||||
|
@ -129,15 +130,14 @@ std::string make_html(std::filesystem::path const &path) {
|
|||
html += ">";
|
||||
tag_h = 0;
|
||||
}
|
||||
if (tag_li) html += "</li>", tag_li = false;
|
||||
if (!tag_li)
|
||||
html += '\n';
|
||||
break;
|
||||
}
|
||||
|
||||
// Start paragraph if newline and no
|
||||
// special characters were matched.
|
||||
|
||||
if (!tag_comment && (!tag_p && newline && x == 0 &&
|
||||
if (!tag_comment && !tag_ul && (!tag_p && newline && x == 0 &&
|
||||
c != '#' && c != '-'))
|
||||
html += "<p>",
|
||||
tag_p = true;
|
||||
|
@ -261,6 +261,10 @@ std::string make_html(std::filesystem::path const &path) {
|
|||
|
||||
// Start unordered list tag if it's not active.
|
||||
if (!tag_ul) html += "<ul>", tag_ul = true;
|
||||
|
||||
// End previous list item, if active.
|
||||
if (tag_li) html += "</li>\n", tag_li = false;
|
||||
|
||||
html += "<li>";
|
||||
ignoreSpace = true;
|
||||
tag_li = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue