Skip to content

Commit

Permalink
fix standard from desc yaml, allow yml files for append target
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrunde committed Nov 6, 2023
1 parent a8798f3 commit 82593c8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions app/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions app/cmd/markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 82593c8

Please sign in to comment.