Compare commits

...

2 Commits

5 changed files with 55 additions and 48 deletions

View File

@ -3,21 +3,23 @@
# this converts the git history into an ATOM feed
# the history should be passed in a specific format. for example
# 2023-05-18T15:36:40+06:00 "added feed.txt, as well as scripts/new_feed_entry.el. i will soon generate my ATOM feeds using feed.txt instead of src/feed.ass"
# 2023-05-18T15:36:40+06:00 "added feed.txt, as well as scripts/new_feed_entry.el. i will soon generate my ATOM feeds using feed.txt instead of src/feed.ass"
# feed.txt
# scripts/new_feed_entry.el
BEGIN {
FS = "\t"
FS = "[\t ]*"
body = ""
}
/^[^#]/ {
date = $1
title = $2
$1 = ""
title = $0
sub("^[\t ]*", "", title)
getline
while ($0 !~ "^[ ]*$") {
while ($0 !~ "^[ \t]*$") {
body = body sprintf("\
<entry>\n\
<title>%s</title>\n\

View File

@ -1,12 +1,12 @@
BEGIN {
title = "techn0path - no title"
body = ""
subHeadings[0] = ""
subHeadings[1] = ""
}
/^#[^#]/ {
match($0, "^#[ ]*")
headingText = substr($0, RSTART + RLENGTH)
headingText = substr($0, RSTART + RLENGTH)
body = body sprintf("<h1>%s</h1>\n", headingText)
title = headingText
next
@ -113,13 +113,16 @@ BEGIN {
}
END {
if (length(subHeadings) > 1) {
if (length(subHeadings) == 1 && subHeadings[1] == "")
delete subHeadings
if (length(subHeadings) > 0) {
tocText = "\n\
<details id='toc'>\n\
<summary>Table of content</summary>\n\
<ol>\n"
for (i = 1; i <= length(subHeadings) - 1; i++)
for (i in subHeadings)
tocText = tocText sprintf("<li><a href='#%s'>%s</a></li>\n", toFilename(subHeadings[i]), subHeadings[i])
tocText = tocText "</ol> </details>\n"

View File

@ -12,7 +12,8 @@ function genNavbarHTML(filename, sourcePath, outputPath) {
<a href='%s'>notes</a> | \n\
<a href='%s'>useful</a> | \n\
<a href='%s'>sitemap</a> | \n\
<a href='%s'>feed</a>\n\
<a href='%s'>feed</a> | \n\
<a href='http://git.vern.cc/techn0path/'>git</a>\n\
</nav>\n", \
relpath(dirname, outputPath "/index.html"), \
relpath(dirname, outputPath "/notes/index.html"), \
@ -32,10 +33,11 @@ function genNavbarGMI(filename, sourcePath, outputPath) {
else
return sprintf("Navigation:\n\
=> %s home\n\
=> %s notes\n\
=> %s useful\n\
=> %s notes \n\
=> %s useful \n\
=> %s sitemap\n\
=> %s feed\n", \
=> %s feed\n\
=> https://git.vern.cc/techn0path/ git", \
relpath(dirname, outputPath "/index.gmi"), \
relpath(dirname, outputPath "/notes/index.gmi"), \
relpath(dirname, outputPath "/useful/index.gmi"), \

View File

@ -1,7 +1,7 @@
2023-05-20T21:12:38+06:00 "renamed feed.txt to feed.tsv. added hooks. made all of the scripts in scripts/ executable"
2023-05-20T21:12:38+06:00 "renamed feed.txt to feed.tsv. added hooks. made all of the scripts in scripts/ executable"
hooks/post-commit
2023-05-18T15:36:40+06:00 "added feed.txt, as well as scripts/new_feed_entry.el. i will soon generate my ATOM feeds using feed.txt instead of src/feed.ass"
2023-05-18T15:36:40+06:00 "added feed.txt, as well as scripts/new_feed_entry.el. i will soon generate my ATOM feeds using feed.txt instead of src/feed.ass"
feed.txt
scripts/new_feed_entry.el

View File

@ -5,84 +5,84 @@
<author>
<name>techn0path</name>
</author>
<updated>2023-05-24T11:11:26Z</updated>
<updated>2023-05-24T11:41:22Z</updated>
<id>urn:uuid:dad753cc-9f1a-55c9-afa5-0f6e50594ed5</id>
<entry>
<title></title>
<title>"renamed feed.txt to feed.tsv. added hooks. made all of the scripts in scripts/ executable" (hooks/post-commit)</title>
<link href='hooks/post-commit' />
<id>urn:uuid:</id>
<updated>2023-05-20T21:12:38+06:00 "renamed feed.txt to feed.tsv. added hooks. made all of the scripts in scripts/ executable"</updated>
<summary></summary>
<updated>2023-05-20T21:12:38+06:00</updated>
<summary>"renamed feed.txt to feed.tsv. added hooks. made all of the scripts in scripts/ executable"</summary>
</entry>
<entry>
<title></title>
<title>"added feed.txt, as well as scripts/new_feed_entry.el. i will soon generate my ATOM feeds using feed.txt instead of src/feed.ass" (feed.txt)</title>
<link href='feed.txt' />
<id>urn:uuid:</id>
<updated>2023-05-18T15:36:40+06:00 "added feed.txt, as well as scripts/new_feed_entry.el. i will soon generate my ATOM feeds using feed.txt instead of src/feed.ass"</updated>
<summary></summary>
<updated>2023-05-18T15:36:40+06:00</updated>
<summary>"added feed.txt, as well as scripts/new_feed_entry.el. i will soon generate my ATOM feeds using feed.txt instead of src/feed.ass"</summary>
</entry>
<entry>
<title></title>
<title>"added feed.txt, as well as scripts/new_feed_entry.el. i will soon generate my ATOM feeds using feed.txt instead of src/feed.ass" (scripts/new_feed_entry.el)</title>
<link href='scripts/new_feed_entry.el' />
<id>urn:uuid:</id>
<updated>2023-05-18T15:36:40+06:00 "added feed.txt, as well as scripts/new_feed_entry.el. i will soon generate my ATOM feeds using feed.txt instead of src/feed.ass"</updated>
<summary></summary>
<updated>2023-05-18T15:36:40+06:00</updated>
<summary>"added feed.txt, as well as scripts/new_feed_entry.el. i will soon generate my ATOM feeds using feed.txt instead of src/feed.ass"</summary>
</entry>
<entry>
<title></title>
<title>"renamed testing/example.ass and testing/example.gmi to testing/input.ass and testing/input.gmi. also added more content to testing/input.gmi for further testing" (testing/input.gmi)</title>
<link href='testing/input.gmi' />
<id>urn:uuid:</id>
<updated>2023-05-17T19:40:57+06:00 "renamed testing/example.ass and testing/example.gmi to testing/input.ass and testing/input.gmi. also added more content to testing/input.gmi for further testing"</updated>
<summary></summary>
<updated>2023-05-17T19:40:57+06:00</updated>
<summary>"renamed testing/example.ass and testing/example.gmi to testing/input.ass and testing/input.gmi. also added more content to testing/input.gmi for further testing"</summary>
</entry>
<entry>
<title></title>
<title>"consolidated navigation bar generation logic into scripts/navbar.awk. also recorded new output testing/output.html as correct." (scripts/navbar.awk)</title>
<link href='scripts/navbar.awk' />
<id>urn:uuid:</id>
<updated>2023-05-17T19:07:04+06:00 "consolidated navigation bar generation logic into scripts/navbar.awk. also recorded new output testing/output.html as correct."</updated>
<summary></summary>
<updated>2023-05-17T19:07:04+06:00</updated>
<summary>"consolidated navigation bar generation logic into scripts/navbar.awk. also recorded new output testing/output.html as correct."</summary>
</entry>
<entry>
<title></title>
<title>"added a glossary" (src/glossary.gmi)</title>
<link href='src/glossary.gmi' />
<id>urn:uuid:</id>
<updated>2023-05-14T15:33:50+06:00 "added a glossary"</updated>
<summary></summary>
<updated>2023-05-14T15:33:50+06:00</updated>
<summary>"added a glossary"</summary>
</entry>
<entry>
<title></title>
<title>"minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff" (testing/example.ass)</title>
<link href='testing/example.ass' />
<id>urn:uuid:</id>
<updated>2023-05-14T15:30:49+06:00 "minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff"</updated>
<summary></summary>
<updated>2023-05-14T15:30:49+06:00</updated>
<summary>"minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff"</summary>
</entry>
<entry>
<title></title>
<title>"minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff" (testing/example.gmi)</title>
<link href='testing/example.gmi' />
<id>urn:uuid:</id>
<updated>2023-05-14T15:30:49+06:00 "minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff"</updated>
<summary></summary>
<updated>2023-05-14T15:30:49+06:00</updated>
<summary>"minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff"</summary>
</entry>
<entry>
<title></title>
<title>"minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff" (testing/output.atom)</title>
<link href='testing/output.atom' />
<id>urn:uuid:</id>
<updated>2023-05-14T15:30:49+06:00 "minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff"</updated>
<summary></summary>
<updated>2023-05-14T15:30:49+06:00</updated>
<summary>"minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff"</summary>
</entry>
<entry>
<title></title>
<title>"minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff" (testing/output.gmi)</title>
<link href='testing/output.gmi' />
<id>urn:uuid:</id>
<updated>2023-05-14T15:30:49+06:00 "minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff"</updated>
<summary></summary>
<updated>2023-05-14T15:30:49+06:00</updated>
<summary>"minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff"</summary>
</entry>
<entry>
<title></title>
<title>"minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff" (testing/output.html)</title>
<link href='testing/output.html' />
<id>urn:uuid:</id>
<updated>2023-05-14T15:30:49+06:00 "minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff"</updated>
<summary></summary>
<updated>2023-05-14T15:30:49+06:00</updated>
<summary>"minor changes to scripts/html.awk. i dunno, stuff to do with the navigation bar i guess. also added snapshot testing via git-diff"</summary>
</entry>
</feed>