1
0
Fork
You've already forked gsp
0
  • Go 96%
  • Makefile 2.1%
  • Groovy 1.9%
Find a file
2026年05月05日 07:05:33 +02:00
ast Pass nodes by pointer 2026年04月18日 15:05:46 +02:00
cmd Improve the CLI UI 2026年04月18日 02:42:53 +02:00
formatter Fix the errors API 2026年04月18日 02:41:20 +02:00
man Rename gsp(5) to gsp(7) 2026年05月05日 07:02:48 +02:00
parser Add another test 2026年04月20日 21:39:56 +02:00
patches Apply patches 2026年04月15日 00:52:46 +02:00
strconv Add more tests 2026年04月18日 02:17:51 +02:00
vendor Huge source rewrite to support script{} and style{} 2026年04月15日 13:38:51 +02:00
.gitignore Ignore gspesc 2026年04月17日 07:13:45 +02:00
example.gsp Remove mdoc macro from example 2026年04月20日 21:37:45 +02:00
go.mod Properly follow go packaging conventions 2026年04月18日 01:19:33 +02:00
go.sum Huge source rewrite to support script{} and style{} 2026年04月15日 13:38:51 +02:00
LICENSE Huge source rewrite to support script{} and style{} 2026年04月15日 13:38:51 +02:00
Makefile Add missing manual installation 2026年05月05日 07:05:33 +02:00
README.md Fix typo in README 2026年04月19日 19:43:44 +02:00

GSP (pronounced gee ess pee) is an HTML-compatible markup language. The standard GSP distribution includes a GSP to HTML transpiler as well as utility programs.

Writing HTML can be made more bearable using things like Emmet, but it’s still not great, and the syntax is far too bloated, visually polluting your documents. It is for this reason that GSP exists.

On top of standard markup, GSP has native support for templating via external processes. This allows the macro implementation to remain extremely small and simple, while retaining a high degree of power.

Source Installation

Installation depends on the Go compiler and make.

First, clone the repository or fetch a release tarball and move into it:

$ git clone https://git.thomasvoss.com/gsp
$ cd gsp

Then you can compile the binaries:

$ make

Finally, you can install the binaries and documentation with the following:

# make install

Documentation

Various manuals ship with the standard GSP distribution:

$ man 1 gsp # transpiler documentation
$ man 1 gspesc # input escaping documentation
$ man 5 gsp # language documentation
$ man 7 gsp-macros # macro system documentation

The example.gsp example document is also provided at the root of the repository, and is installed along with the other manual pages (typically at /usr/share/gsp/doc, but the exact location will vary per system).

Syntax Example

html lang="en" {
	head {
		meta charset="UTF-8" {}
		meta
			name="viewport"
			content="width=device-width, initial-scale=1.0"
		{}
		link href="/style.css" rel="stylesheet" {}
		title {- GSP Language Reference}
	}
	body {
		p #first-p .red {-
			GSP allows us to define IDs and classes on
			tags in a manner that matches CSS selector
			syntax.
		}
		/ div {
			p {-
				It also supports comments that operate
				on a syntactical level.
			}
			p {- Isn’t that neat? }
		}
		p {-
			GSP also features a powerful macro system,
			allowing us to perform tasks like syntax
			highlighting source code from within a
			document.
		}
		$$syntax_highlight lang="c" {-
#include <stdio.h>
#include <stdlib.h>
int
main(int argc, char **argv)
{
	puts("Hello, World!");
	return EXIT_SUCCESS;
}
		}
	}
}

Why The Name GSP?

I was originally inspired by Pug, but my dog is a GSP, not a pug.