forked from testcontainers/testcontainers-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into generate-vscode-workspace
* main: modulegen: generate md file inside internal/mkdocs (testcontainers#1543)
- Loading branch information
Showing
4 changed files
with
38 additions
and
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package mkdocs | ||
|
||
import ( | ||
"path/filepath" | ||
"text/template" | ||
|
||
internal_template "github.com/testcontainers/testcontainers-go/modulegen/internal/template" | ||
) | ||
|
||
func GenerateMdFile(filePath string, funcMap template.FuncMap, example any) error { | ||
name := "example.md.tmpl" | ||
t, err := template.New(name).Funcs(funcMap).ParseFiles(filepath.Join("_template", name)) | ||
if err != nil { | ||
return err | ||
} | ||
return internal_template.Generate(t, filePath, name, example) | ||
} |
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