💾 Archived View for gemini.ctrl-c.club › ~stack › code › gemlit › gemlit.c captured on 2022-07-17 at 02:59:26.
-=-=-=-=-=-=-
/*********************************************************************** (c) Copyright 2021 StackSmith All Rights Reserverd Distributed under BSD 3-clause license (attached below) gemlit supports literate programming using gemtext (and markdown), by commenting away non-code segments of a source file. The comment string is specified as an optional second parameter, and defaults to // (for C and C++) The file may contain arbitrary gemtext, mixed with code which must be enclosed into one or more pre-format blocks bound by lines starting with ```. Such files may be transmitted and viewed by any gemini browser, and compiled after commenting non-code text with this utility. gcc gemlit.c -o gemlit Usage gemlit <file> (<comment-marker>) The processed file is output to stdout for piping into the compiler. The logistics of using gemlit depend on your preferences. You may wish to convert an entire directory of files, renaming them from .c gmi to .c. Another approach is to create a makefile that processes each file, piping it to the compiler.