import { readFileSync } from "fs" ; export function getTemplate ( docstringFormat ) { switch ( docstringFormat ) { case "google" : return getTemplateFile ( "google.mustache" ) ; case "google-notypes" : return getTemplateFile ( "google-notypes.mustache" ) ; case "sphinx" : return getTemplateFile ( "sphinx.mustache" ) ; case "numpy" : return getTemplateFile ( "numpy.mustache" ) ; case "oneline-rst" : return getTemplateFile ( "oneline-rst.mustache" ) ; default : return getTemplateFile ( "default.mustache" ) ; } } export function getCustomTemplate ( templateFilePath ) { return readFileSync ( templateFilePath , "utf8" ) ; } function getTemplateFile ( fileName ) { const filePath = __dirname + "/templates/" + fileName ; return readFileSync ( filePath , "utf8" ) ; }