From 82593c813ce371b4b3fc2bb9a9e1571e208b9b41 Mon Sep 17 00:00:00 2001 From: Peter Grunde Date: Mon, 6 Nov 2023 14:57:37 -0700 Subject: [PATCH] fix standard from desc yaml, allow yml files for append target --- README.md | 6 +++++- app/cmd/config.go | 1 + app/cmd/markdown.go | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8af6b30..3d19604 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,11 @@ learn help ## Get Started: Walkthrough -Visit [Guru](https://app.getguru.com/boards/iEdB57dT/Creating-Content-in-Learn) for a short walkthrough to publish your first curriculum. +You can generate a sample piece of curriculum to begin a walkthrough of how to develop curriculum with Learn with + +``` +learn walkthrough +``` ### Get Started: Quick Edits to Existing Curriculum diff --git a/app/cmd/config.go b/app/cmd/config.go index ebb267e..bc1a437 100644 --- a/app/cmd/config.go +++ b/app/cmd/config.go @@ -578,6 +578,7 @@ func newStandard(unitDir, unit string) Standard { return standardFromUnit(unit) } else { // read yaml contents of file + //return standardFromUnit(unit) standard := Standard{} if err = yaml.NewDecoder(bytes.NewReader(yamlBytes)).Decode(&standard); err != nil { return standardFromUnit(unit) diff --git a/app/cmd/markdown.go b/app/cmd/markdown.go index b23368a..d62d11b 100644 --- a/app/cmd/markdown.go +++ b/app/cmd/markdown.go @@ -102,8 +102,8 @@ func (t temp) appendContent(target string) error { if Minimal { template = t.MinTemplate } - if !strings.HasSuffix(target, ".md") { - return fmt.Errorf("'%s' must have an `.md` extension to append %s content.\n", target, t.Name) + if !(strings.HasSuffix(target, ".md") || strings.HasSuffix(target, ".yaml") || strings.HasSuffix(target, ".yml")) { + return fmt.Errorf("'%s' must have an `.md`, `.yml`, or `.yaml` extension to append %s content.\n", target, t.Name) } targetInfo, err := os.Stat(target)