Skip to content

Commit

Permalink
Merge pull request #9 from chrishrb/8-missing-support-for-github-mark…
Browse files Browse the repository at this point in the history
…down-emojis

8 Add support for github markdown emojis
  • Loading branch information
chrishrb authored Dec 18, 2024
2 parents 7152e25 + 6a951c0 commit 86b742d
Show file tree
Hide file tree
Showing 28 changed files with 1,296 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
go-version: 1.23

- name: Build
run: make build
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/emojiscraper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Emojiscraper

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # Runs every Sunday at midnight UTC

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23

- name: Run emojiscraper
run: make emojiscraper

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.PAT }}
commit-message: Update dependencies
branch: emojiscraper-updates
commit-message: Update from weekly emojiscraper run
title: "Weekly Emojiscraper Update"
body: "Automated update from the weekly Emojiscraper run."
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: 1.22
goversion: 1.23
binary_name: "go-grip"
extra_files: LICENSE README.md
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
.PHONY: all format lint clean

# If the first argument is "run"...
ifeq (run,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "run"
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(RUN_ARGS):;@:)
endif

GOCMD=go
LDFLAGS="-s -w ${LDFLAGS_OPT}"

all: build format lint ## Format, lint and build

run: ## Run
go run main.go
go run -tags debug main.go $(RUN_ARGS)

emojiscraper: ## Run emojiscraper
go run -tags debug main.go emojiscraper defaults/static/emojis pkg/emoji_map.go

build: ## Build
go build -o bin/go-grip main.go
go build -tags debug -o bin/go-grip main.go

test: ## Test
${GOCMD} test ./...
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@

## ⚡️Features

* ⚡️Written in Go
* ⚡️Written in Go :+1:
* 📄 Render markdown to HTML and view it in your browser
* 📱 Dark and white mode
* 🎨 Syntax highlighting for code
* [x] Todo list like the one on GitHub
* Support for github markdown emojis :+1: :bowtie:
* Support for mermaid diagrams

```mermaid
Expand Down
26 changes: 26 additions & 0 deletions cmd/emojiscraper.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//go:build debug
// +build debug

package cmd

import (
"errors"

"github.com/chrishrb/go-grip/internal"
"github.com/spf13/cobra"
)

var emojiscraperCmd = &cobra.Command{
Use: "emojiscraper [emoji-out] [emoji-map-out]",
Short: "Scrape emojis from gist",
Run: func(cmd *cobra.Command, args []string) {
if len(args) != 2 {
cobra.CheckErr(errors.New("provide exact 2 arguments"))
}
internal.ScrapeEmojis(args[0], args[1])
},
}

func init() {
rootCmd.AddCommand(emojiscraperCmd)
}
Binary file added defaults/static/emojis/bowtie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/feelsgood.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/finnadie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/goberserk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/godmode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/hurtrealbad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/neckbeard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/octocat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/rage1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/rage2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/rage3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/rage4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/shipit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/suspect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added defaults/static/emojis/trollface.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
go-grip = pkgs.buildGoModule {
name = "go-grip";
src = self;
vendorHash = "sha256-KNKlWm/UaweRlnXD7a0C446IecjLOSwnzKvSoJfcOdE=";
vendorHash = "sha256-tfvhMbe0uSWIfaUUawEYe+7ckBttwM1IokKAWBLi8ig=";
};
in
{
Expand Down
24 changes: 21 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
module github.com/chrishrb/go-grip

go 1.22.7
go 1.23

toolchain go1.23.3

require (
github.com/PuerkitoBio/goquery v1.10.0 // indirect
github.com/aarol/reload v1.1.3 // indirect
github.com/alecthomas/chroma/v2 v2.14.0 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/antchfx/htmlquery v1.3.3 // indirect
github.com/antchfx/xmlquery v1.4.2 // indirect
github.com/antchfx/xpath v1.3.3 // indirect
github.com/bep/debounce v1.2.1 // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gocolly/colly v1.2.0 // indirect
github.com/gocolly/colly/v2 v2.1.0 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/gomarkdown/markdown v0.0.0-20240930133441-72d49d9543d8 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kennygrant/sanitize v1.2.4 // indirect
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.16.0 // indirect
github.com/temoto/robotstxt v1.1.2 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.36.0 // indirect
)
Loading

0 comments on commit 86b742d

Please sign in to comment.