-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tabler): update tabler to use go (#61)
* rm scripts update tools * update * ci * rm toolchain * update workflow * workflow * workflow * reset workflow
- Loading branch information
Showing
10 changed files
with
180 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
presentations/2023-03-13--gophercon_submission--jae/metadata.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Date of the workshop | ||
date: "2023-03-13" | ||
# Title of the workshop | ||
title: "GopherCon Submission" | ||
# GitHub usernames of the speakers | ||
speakers: | ||
- "jaekwon" | ||
# Location of the workshop | ||
location: "" | ||
# At which event the workshop took place, if any | ||
event: "" | ||
# Workshop slides link. If the link is local, only put the file name, without any other path parts. | ||
slides: "README.md" | ||
# Workshop recording | ||
recording: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"os" | ||
"strings" | ||
|
||
"github.com/gnolang/gno/tm2/pkg/commands" | ||
) | ||
|
||
func newFormatCmd(cfg *cfg) *commands.Command { | ||
cmd := commands.NewCommand( | ||
commands.Metadata{ | ||
Name: "format", | ||
ShortHelp: "remove codeblocks from the README table", | ||
}, | ||
commands.NewEmptyConfig(), | ||
func(_ context.Context, args []string) error { | ||
return execFormat(cfg) | ||
}, | ||
) | ||
return cmd | ||
} | ||
|
||
// execFormat removes an existing table if rmTable is set, and removes the codeblock after table generation happened | ||
func execFormat(cfg *cfg) error { | ||
read, err := os.ReadFile(cfg.readmePath) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
cts := string(read) | ||
newContents := "" | ||
|
||
// Called to remove the old table | ||
if cfg.rmTable { | ||
lines := strings.Split(cts, "\n") | ||
newLines := make([]string, 0, len(lines)) | ||
for _, line := range lines { | ||
if strings.Index(line, "|") != 0 { | ||
newLines = append(newLines, line) | ||
} | ||
} | ||
|
||
newContents = strings.Join(newLines, "\n") | ||
|
||
} else { | ||
// called to remove the codeblock | ||
newContents = strings.Replace(cts, "```md", "", 1) | ||
newContents = strings.Replace(newContents, "```", "", 1) | ||
} | ||
|
||
if cts == newContents { | ||
fmt.Println("Nothing to format.") | ||
return nil | ||
} | ||
|
||
err = os.WriteFile(cfg.readmePath, []byte(newContents), 0) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
fmt.Println("Formatted README.md") | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters