Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Release v0.1.0
  • Loading branch information
tdemin committed Nov 20, 2020
2 parents 4763bf1 + 2d55d4f commit 26fcc06
Show file tree
Hide file tree
Showing 10 changed files with 675 additions and 116 deletions.
27 changes: 27 additions & 0 deletions .drone.yml
@@ -0,0 +1,27 @@
kind: pipeline
name: build & release

steps:
- name: fetch tags
image: docker:git
commands:
- git fetch --tags
when:
event: tag
- name: test
image: golang:1.14
commands:
- go test -v ./internal/gemini
when:
event:
exclude:
- tag
- name: release
image: golang:1.15
environment:
GITEA_TOKEN:
from_secret: goreleaser_gitea_token
commands:
- curl -sL https://git.io/goreleaser | bash
when:
event: tag
53 changes: 53 additions & 0 deletions .goreleaser.yml
@@ -0,0 +1,53 @@
builds:
- main: ./cmd/gmnhg
id: gmnhg
binary: gmnhg
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
- freebsd
- openbsd
- netbsd
- main: ./cmd/md2gmn
id: md2gmn
binary: md2gmn
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
- freebsd
- openbsd
- netbsd
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
freebsd: FreeBSD
openbsd: OpenBSD
netbsd: NetBSD
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

release:
gitea:
owner: tdemin
name: gmnhg

gitea_urls:
api: https://git.tdem.in/api/v1/
38 changes: 25 additions & 13 deletions README.md
@@ -1,5 +1,7 @@
# Hugo-to-Gemini converter

[![PkgGoDev](https://pkg.go.dev/badge/git.tdem.in/tdemin/gmnhg)](https://pkg.go.dev/git.tdem.in/tdemin/gmnhg)

This repo holds a converter of Hugo Markdown posts to
[text/gemini][Gemtext] (also named Gemtext in this README). The
converter is supposed to make people using [Hugo](https://gohugo.io)'s
Expand All @@ -9,21 +11,35 @@ simpler.
[Gemini]: https://gemini.circumlunar.space
[Gemtext]: https://gemini.circumlunar.space/docs/specification.html

At this stage of development this repo contains the actual renderer
(`internal/gemini`) and the `md2gmn` program that converts Markdown
input to Gemtext and is supposed to facilitate testing.

The renderer is somewhat hasty, and is NOT supposed to be able to
convert the entirety of possible Markdown to Gemtext (as it's not
possible to do so, considering Gemtext is a lot simpler than Markdown),
but instead a selected subset of it, enough for conveying your mind in
Markdown.

The renderer uses the [gomarkdown][gomarkdown] library for parsing
Markdown.
Markdown. gomarkdown has a few quirks at this time, the most notable one
being unable to parse links/images inside other links.

[gomarkdown]: https://github.com/gomarkdown/markdown

## gmnhg

This program converts Hugo Markdown content files from `content/` in
accordance with templates found in `gmnhg/` to the output dir. It
also copies static files from `static/` to the output dir.

For more details about the rendering process, see the
[doc](cmd/gmnhg/main.go) attached to the program.

```
Usage of gmnhg:
-output string
output directory (will be created if missing) (default "output/")
-working string
working directory (defaults to current directory)
```

## md2gmn

This program reads Markdown input from either text file (if `-f
Expand All @@ -35,15 +51,11 @@ Usage of md2gmn:
input file
```

## TODO

+ [x] convert Markdown text to Gemtext
+ [ ] prepend contents of YAML front matter to Gemtext data
+ [ ] render all Hugo content files to Gemtext in accordance with front
matter data and Hugo config
md2gmn is mainly made to facilitate testing the Gemtext renderer but
can be used as a standalone program as well.

## License

This program is redistributed under the terms and conditions of the GNU
General Public License, more specifically under version 3 of the
License. For details, see [COPYING](COPYING).
General Public License, more specifically version 3 of the License. For
details, see [COPYING](COPYING).

0 comments on commit 26fcc06

Please sign in to comment.