Skip to content

Commit

Permalink
added keys to keyzen root with tool debugging (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
kghenderson committed Oct 2, 2022
1 parent 3617fb4 commit 443998e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
59 changes: 33 additions & 26 deletions pkg/keyzen/cuetools/tangle_sublimetext_tool.cue
Original file line number Diff line number Diff line change
@@ -1,51 +1,58 @@
package keyzen

import (
// "encoding/yaml"
"encoding/yaml"
"text/template"
"tool/cli"
// "tool/file"
"tool/file"

"github.com/kghenderson/keyzen"
)

command: tangle_sublimetext: {
args: {
editorName: "SublimeText"
strokesName: "ZenStrokes1"
fileName: "_sublime_strokes.txt"
editorName: "SublimeText"
strokesName: "ZenStrokes1"
platformName: "PC"
fileName: "_sublime_strokes.txt"
}

do: {
selectedSource: {
editorName: args.editorName
strokesName: args.strokesName
commands: keyzen.KeyZen.Commands
editor: keyzen.KeyZen.Editors["\(editorName)"]
strokes: keyzen.KeyZen.Strokes["\(strokesName)"]
buildSource: {
source: {
editorName: args.editorName
strokesName: args.strokesName
platformName: args.platformName
commands: keyzen.KeyZen.Commands
keys: keyzen.KeyZen.Keys
editor: keyzen.KeyZen.Editors["\(editorName)"]
strokes: keyzen.KeyZen.Strokes["\(strokesName)"]
}
}
// echoSelectedSource: cli.Print & {text: yaml.Marshal(selectedSource)}
// debugSourceCli: cli.Print & {text: yaml.Marshal(buildSource.source)}
debugSourceFile: file.Create & {filename: "_src.yaml", contents: yaml.Marshal(buildSource.source)}

templateText: {
text: template.Execute(sublimeKeymapTemplate, selectedSource)
genText: {
$after: buildSource
text: template.Execute(sublimeKeymapTemplate, buildSource.source)
}
echoTemplateText: cli.Print & {text: templateText.text}
// debugGenText: cli.Print & {text: genText.text}

// createFile: file.Create & {
// $after: getText
// filename: args.fileName
// contents: getText.text
// }
createFile: file.Create & {
$after: genText
filename: args.fileName
contents: genText.text
}

doneMsg: "done tangling: " + args.editorName + ", " + args.strokesName
}

// done: {
// $after: do
// print: cli.Print & {
// text: do.doneMsg
// }
// }
done: {
$after: do
print: cli.Print & {
text: do.doneMsg
}
}
}

// language=gotemplate
Expand Down
2 changes: 2 additions & 0 deletions pkg/keyzen/keyzen.cue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ package keyzen
import (
"github.com/kghenderson/keyzen/commands"
"github.com/kghenderson/keyzen/editors"
"github.com/kghenderson/keyzen/keys"
"github.com/kghenderson/keyzen/strokes"
)

KeyZen: {
Commands: commands.Commands
Editors: editors.Editors
Keys: keys.Keys
Strokes: strokes.Strokes
}

0 comments on commit 443998e

Please sign in to comment.