Contents of this page:
Code sample
Level 3

A more complex test post

I need a more complex post to test how this blog format will work out. We'll include samples of various Spartan content types.


This is the quote of the day. I should have looked up some pithy quote by somebody more interesting than me, but I didn't. -- me

Code sample

Here is the current version of the "bp" blog post helper script.


# bp - a Spartan blog helper to create a new blog post

# Where is the blog directory?

fname=$(date -Iminutes)  # get current date and time
cdate="${fname/T/ }"     # capture file creation date for potential use in the post text
fname="${fname%-*}.gmi"  # create a name for the file.

# Create the new file.
printf "# new\n\ntext\n\nšŸ“…_c: %s  āœļø e: \ntags: #new\n" "${cdate%-*}" >> "$blogdir/$fname"
# Verify that the file was created? No, if the editor opens an empty file it will be obvious something is wrong.

echo "New post is at: $blogdir/$fname"  # This makes it easy to re-edit the file if you need to.

# Edit the new post
"$EDITOR" "$blogdir/$fname" # ToDo: check whether $EDITOR is set?

# Display the result so you can review it for errors.
cat "$blogdir/$fname"


There is not a table type included in gemtext, but preformatted text can be used to display tabular data. I don't have a good sample data table already built so here is a scrap from another document that I can quickly paste in.

ā”‚    Note     ā”‚           1952           ā”‚          1966           ā”‚          2015           ā”‚
ā”‚             ā”‚ This is the text as I    ā”‚                         ā”‚                         ā”‚
ā”‚             ā”‚ copied it from my        ā”‚                         ā”‚                         ā”‚
ā”‚             ā”‚ mother's signed and      ā”‚                         ā”‚ The current text as     ā”‚
ā”‚             ā”‚ framed document from     ā”‚                         ā”‚ available as            ā”‚
ā”‚             ā”‚ 1952. It may have been   ā”‚ I copied this text from ā”‚                         ā”‚
ā”‚             ā”‚ in use in this form ever ā”‚ my own document that I  ā”‚ [SOLDIER'S COVENANT]    ā”‚
ā”‚ Source      ā”‚ since the 1880s; it      ā”‚ signed in December      ā”‚                         ā”‚
ā”‚             ā”‚ appears to have been     ā”‚ 1966.                   ā”‚ at The Salvation Army   ā”‚
ā”‚             ā”‚ quoted in Thomas H.      ā”‚                         ā”‚ International           ā”‚
ā”‚             ā”‚ Huxley's                 ā”‚                         ā”‚                         ā”‚
ā”‚             ā”‚ [Legal Opinions]         ā”‚                         ā”‚                         ā”‚
ā”‚ Title       ā”‚ Articles of War          ā”‚ Articles of War         ā”‚ SOLDIER'S COVENANT      ā”‚
ā”‚             ā”‚                          ā”‚                         ā”‚ (Promises made when     ā”‚
ā”‚             ā”‚ Signed by all Salvation  ā”‚ Signed by all Salvation ā”‚ becoming a soldier in   ā”‚
ā”‚ Explanation ā”‚ Army Soldiers            ā”‚ Army Soldiers           ā”‚ The Salvation Army.     ā”‚
ā”‚             ā”‚                          ā”‚                         ā”‚ Formerly called         ā”‚
ā”‚             ā”‚                          ā”‚                         ā”‚ 'Articles of War'.)     ā”‚
ā”‚             ā”‚ Having received with all ā”‚ Having received with    ā”‚                         ā”‚
ā”‚             ā”‚ my heart the salvation   ā”‚ all my heart the        ā”‚                         ā”‚
ā”‚             ā”‚ offered to me by the     ā”‚ Salvation offered to me ā”‚                         ā”‚
ā”‚             ā”‚ tender mercy of Jehovah, ā”‚ by the tender mercy of  ā”‚                         ā”‚
ā”‚             ā”‚ I do here and now        ā”‚ God, I do here and now  ā”‚ HAVING accepted Jesus   ā”‚
ā”‚             ā”‚ publicly acknowledge God ā”‚ acknowledge God the     ā”‚ Christ as my Saviour    ā”‚
ā”‚             ā”‚ the Father to be my      ā”‚ Father to be my King;   ā”‚ and Lord, and desiring  ā”‚
ā”‚             ā”‚ king, God the Son, Jesus ā”‚ God the Son, Jesus      ā”‚ to fulfil my membership ā”‚
ā”‚ Motivation  ā”‚ Christ our Lord, to be   ā”‚ Christ our Lord, to be  ā”‚ of His Church on earth  ā”‚
ā”‚             ā”‚ my Saviour, God the Holy ā”‚ my Saviour; and God the ā”‚ as a soldier of The     ā”‚
ā”‚             ā”‚ Spirit to be my Guide,   ā”‚ Holy Spirit to be my    ā”‚ Salvation Army, I now   ā”‚
ā”‚             ā”‚ Comforter, and Strength; ā”‚ Guide, Comforter and    ā”‚ by God's grace enter    ā”‚
ā”‚             ā”‚ and I will, by His help, ā”‚ Strength; and I will,   ā”‚ into a sacred covenant. ā”‚
ā”‚             ā”‚ love, serve, worship and ā”‚ by His help, love,      ā”‚                         ā”‚
ā”‚             ā”‚ obey this glorious God   ā”‚ serve, worship, and     ā”‚                         ā”‚
ā”‚             ā”‚ through time and through ā”‚ obey this glorious God  ā”‚                         ā”‚
ā”‚             ā”‚ eternity.                ā”‚ through time and        ā”‚                         ā”‚
ā”‚             ā”‚                          ā”‚ through eternity.       ā”‚                         ā”‚


Of course we should include a list.

My, what a pitiful list that was.


There must a level3 heading:

Level 3

And here it is.

I think we're done here, for now.

Now it is time to test, test, test using the varios Spartan clients I have installed. So far, I am satisfied with what I'm seeing in both GUI and text-mode clients. Once I resolve the file-name, date-sorted index list issue (discussed in my Spartan [blog] working document) I think it's ready for regular use.

šŸ“… c: 2022-07-14 08:10 āœļøe: 2022-07-14 15:11

tags: #test #gemtext

Mastodon Mastodon Mastodon šŸŒ

Search this site at