S3G - loglot Blogs

S3G

 

You Can Just Make A File Format.

nobody’s stopping you

so that’s just what i did. s3g / sssg / stupid simple script generator
i made this format for a small script generation progect which i only made because i made a script that ran yazi cleanly without fully installing it, and i wanted to be able to easily configure that script

more info on the format is available here, but that’s not what this post is fully about

Why I Made it A Different File

.s3g is bascially a glorified .txt file, so why did i make it something else? well, .md is also a glorified .txt file aswell

s3g files contain the info for the interpreter to generate scripts including headers of code segments, escape sequences, and maybe some more

How I Made it

i just switched the text files that had the contents to .s3g files, a few problems occured with that though, previewing in chrome broke, so i had to make a simple previewer, and i also wanted to make vscode able to have its syntax…


github… what the hell…

so, github codespaces. i use it to make most of the stuff i make, because most of the time, i don’t have access to a computer, and it’s really good… mostly… in this instance however…

so i made the extension following your first extension and syntax highlight guide, and i did get a unique syntax highlighter for .s3g files to start with, however, modifying it just didn’t work? no matter what i did, it wouldn’t update the extension (there were some mistakes i made while initially making it, but i fixed those and it still didn’t work) so i tried renaming the file… and it changed… changing it back in package.json made it go back to the original version of the file. why??? i have no damn clue.

visual aid:

package.json » calls for syntax.json
syntax.json » changes contents (displayed with [1])
package.json doesn’t get syntax.json[1], it gets syntax.json[0]
syntax.json[1] » renamed to syntax1.json[0]
package.json » calls for syntax1.json
package.json gets syntax1.json[0]
syntax1.json[0] » changes contents (syntax1.json[1])
package.json still gets syntax1.json[0]

later when i got home, i tried again on my personal machine, not on a codespace, and it worked fine, so i guess something is wrong with github codespaces…

at time of writing, i have not finished this extension, i still have work to do on it, and hopefully i can get it done, though i have no clue how to get any colors apart from string and keyword, so i don’t know.