coba revert
This commit is contained in:
parent
3519e2e63c
commit
3507a9f538
40
main.c
40
main.c
|
|
@ -21,7 +21,6 @@ typedef struct {
|
||||||
int italic;
|
int italic;
|
||||||
int hyperlink;
|
int hyperlink;
|
||||||
int code;
|
int code;
|
||||||
int blockcode;
|
|
||||||
int headingone;
|
int headingone;
|
||||||
int headingtwo;
|
int headingtwo;
|
||||||
int headingthree;
|
int headingthree;
|
||||||
|
|
@ -251,10 +250,7 @@ void copy_css(void) {
|
||||||
|
|
||||||
void newsetup(void) {
|
void newsetup(void) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (stat("./source", &st) == -1) {
|
if (stat("./source", &st) == -1) mkdir("./source", 0700);
|
||||||
mkdir("./source", 0700);
|
|
||||||
mkdir("./source/post", 0700);
|
|
||||||
}
|
|
||||||
if (stat("./target", &st) == -1) mkdir("./target", 0700);
|
if (stat("./target", &st) == -1) mkdir("./target", 0700);
|
||||||
if (stat("./media", &st) == -1) {
|
if (stat("./media", &st) == -1) {
|
||||||
mkdir("./media", 0700);
|
mkdir("./media", 0700);
|
||||||
|
|
@ -393,7 +389,7 @@ docode(void) {
|
||||||
mdt.code = 0;
|
mdt.code = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
dohyperlink(void) {
|
dohyperlink(void) {
|
||||||
int start_linkname = i + 1;
|
int start_linkname = i + 1;
|
||||||
|
|
@ -446,6 +442,8 @@ dohyperlink(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
void build(void) {
|
||||||
|
}
|
||||||
|
|
||||||
void generate(void) {
|
void generate(void) {
|
||||||
|
|
||||||
|
|
@ -466,7 +464,7 @@ void generate(void) {
|
||||||
txt[--len] = '\0';
|
txt[--len] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
mdt.headingone = mdt.headingtwo = mdt.headingthree = mdt.quote = mdt.blockcode = 0;
|
mdt.headingone = mdt.headingtwo = mdt.headingthree = mdt.quote = 0;
|
||||||
|
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
fprintf(fpto, "\n");
|
fprintf(fpto, "\n");
|
||||||
|
|
@ -474,7 +472,6 @@ void generate(void) {
|
||||||
i = 0;
|
i = 0;
|
||||||
judul = 0;
|
judul = 0;
|
||||||
|
|
||||||
|
|
||||||
if (txt[0] == '#') {
|
if (txt[0] == '#') {
|
||||||
int heading_count = 0;
|
int heading_count = 0;
|
||||||
while (i < len && txt[i] == '#') {
|
while (i < len && txt[i] == '#') {
|
||||||
|
|
@ -502,27 +499,6 @@ if (txt[0] == '#') {
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if(len > 1 && txt[0] == '`' && txt[1] == '`' && txt[2] == '`' && (i == 0 || txt[3] != '\\')) {
|
|
||||||
if (!mdt.blockcode) {
|
|
||||||
fprintf(fpto, "<pre><code>");
|
|
||||||
mdt.blockcode = 1;
|
|
||||||
i += 3;
|
|
||||||
} else {
|
|
||||||
fprintf(fpto, "</code></pre>");
|
|
||||||
mdt.blockcode = 0;
|
|
||||||
i += 3;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
} else if (mdt.blockcode) {
|
|
||||||
int start = i;
|
|
||||||
while (i < len && !(i + 2 < len && txt[i] == '`' && txt[i+1] == '`' && txt[i+2] == '`' && (i == 0 || txt[i+3] != '\\'))) {
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
fprintf(fpto, "%.*s", i - start, txt + start);
|
|
||||||
if (i < len && i + 2 < len && txt[i] == '`' && txt[i+1] == '`' && txt[i+2] == '`') {
|
|
||||||
i += 2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (len > 1 && txt[0] == '>' && txt[1] != '\\') {
|
else if (len > 1 && txt[0] == '>' && txt[1] != '\\') {
|
||||||
doblockquote();
|
doblockquote();
|
||||||
|
|
@ -555,10 +531,9 @@ else if(len > 1 && txt[0] == '`' && txt[1] == '`' && txt[2] == '`' && (i == 0 ||
|
||||||
else if (mdt.headingone) fprintf(fpto, "</h1>\n");
|
else if (mdt.headingone) fprintf(fpto, "</h1>\n");
|
||||||
else if (mdt.headingtwo) fprintf(fpto, "</h2>\n");
|
else if (mdt.headingtwo) fprintf(fpto, "</h2>\n");
|
||||||
else if (mdt.headingthree) fprintf(fpto, "</h3>\n");
|
else if (mdt.headingthree) fprintf(fpto, "</h3>\n");
|
||||||
|
if (!(mdt.headingone || mdt.headingtwo || mdt.headingthree || mdt.quote)) fprintf(fpto, "</p>\n");
|
||||||
|
|
||||||
if (!(mdt.headingone || mdt.headingtwo || mdt.headingthree || mdt.quote || mdt.blockcode)) fprintf(fpto, "</p>\n");
|
mdt.italic = mdt.bold = mdt.quote = mdt.headingone = mdt.headingtwo = mdt.headingthree = mdt.code = 0;
|
||||||
|
|
||||||
mdt.italic = mdt.bold = mdt.quote = mdt.headingone = mdt.headingtwo = mdt.headingthree = mdt.code = mdt.blockcode = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -655,4 +630,3 @@ int main(int argc, char *argv[]) {
|
||||||
printf("salah perintah\n");
|
printf("salah perintah\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
10
style.css
10
style.css
|
|
@ -1,5 +1,5 @@
|
||||||
body {
|
body {
|
||||||
background: #000;
|
background: #01242e;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
|
@ -8,16 +8,16 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
blockquote {
|
blockquote {
|
||||||
background:#880808;
|
background:#1A3440;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:link {
|
a:link {
|
||||||
color: #880808;
|
color: #EAE2C6;
|
||||||
}
|
}
|
||||||
a:visited {
|
a:visited {
|
||||||
color: #880808;
|
color: #EAE2C6
|
||||||
}
|
}
|
||||||
a:hover {
|
a:hover {
|
||||||
color: #000;
|
color: #01242e;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user