From 86b7ea67305c1ce411789ba3e53e3830a295a7ed Mon Sep 17 00:00:00 2001 From: cluttrdev Date: Sun, 26 Feb 2023 21:22:50 +0100 Subject: [PATCH] Release v0.1.0 --- .gitignore | 2 ++ .goreleaser.yaml | 49 ++++++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 14 ++++++++++++ LICENSE | 21 ++++++++++++++++++ README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++- go.mod | 2 +- 6 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 .goreleaser.yaml create mode 100644 CHANGELOG.md create mode 100644 LICENSE diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cde0123 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..a68154a --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,49 @@ +before: + hooks: + - go mod tidy + - go generate ./... +builds: + - id: showdown + main: ./cmd/showdown/ + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm + - arm64 + goarm: [6, 7] + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of uname. + name_template: >- + {{ .ProjectName }}_ + {{- .Tag }}_ + {{- .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + +# The lines beneath this are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..353260e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.0] - 2023-02-26 + +Initial version, providing a working proof-of-concept. + +[0.1.0]: https://github.com/cluttrdev/showdown/releases/tag/v0.1.0 + + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e381bc5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Andreas Kunze + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 82d5cbf..5ed96a6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,58 @@ -# showdown +# Showdown +Showdown is a live Markdown previewer. + +It uses [fsnotify][github-fsnotify] to watch a given file for changes, +renders the content to HTML using [markdown][github-gomarkdown] +and serves the output on your local machine. + +For an update on the latest changes please have a look at the +[CHANGELOG](./CHANGELOG.md) + +## Installation + +To install `showdown` you can download a prebuild binary from the +[releases](https://github.com/cluttrdev/showdown/releases) page. + +E.g. if you're on Linux: + +```shell +# determine latest release +RELEASE_TAG=$(curl -sSL https://api.github.com/repos/cluttrdev/showdown/releases/latest | jq -r '.tag_name') +# download release archive +curl -sSL -O https://github.com/cluttrdev/showdown/releases/download/${RELEASE_TAG}/showdown_${RELEASE_TAG}_linux_x86_64.tar.gz +# extract binary +tar -zxf showdown_${RELEASE_TAG}_linux_x86_64.tar.gz showdown +# install it +install ./showdown /usr/local/bin/showdown +``` + +Alternatively, you can install it using the standard Go tools. + +```shell +go install github.cluttrdev/showdown@latest +``` + +## Usage + +To preview a Markdown formatted file `example.md` simply run + +```shell +showdown example.md +``` + +This will render the file content as HTML and serve it under + +Run `showdown --help` for more information. + +## Acknowledgement + +This project was inspired by [livedown][github-livedown]. + +## License + +This project is released under the [MIT License](./LICENSE) + +[github-fsnotify]: https://github.com/fsnotify/fsnotify +[github-gomarkdown]: https://github.com/gomarkdown/markdown +[github-livedown]: https://github.com/shime/livedown diff --git a/go.mod b/go.mod index dd69c32..17cf81d 100644 --- a/go.mod +++ b/go.mod @@ -6,12 +6,12 @@ require ( github.com/fsnotify/fsnotify v1.6.0 github.com/gomarkdown/markdown v0.0.0-20221013030248-663e2500819c github.com/pkg/errors v0.9.1 + github.com/spf13/cobra v1.6.1 golang.org/x/net v0.7.0 ) require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/spf13/cobra v1.6.1 // indirect github.com/spf13/pflag v1.0.5 // indirect golang.org/x/sys v0.5.0 // indirect )