code: func NewSanicServer(apiDef *raml.APIDefinition, apiDocsDir, targetDir string, withMain bool,
  	libRootURLs []string) *SanicServer {
  	var prs []pythonResource
  	for _, rd := range getServerResourcesDefs(apiDef) {
  		pr := newResource(rd, apiDef, serverKindSanic)
  		prs = append(prs, pr)
  	}
  
  	// TODO : get rid of this global variables
  	globAPIDef = apiDef
  	globLibRootURLs = libRootURLs
  
  	templates := templates(serverKindSanic)
  
  	return &SanicServer{
  		APIDef:       apiDef,
  		Title:        apiDef.Title,
  		apiDocsDir:   apiDocsDir,
  		withMain:     withMain,
  		ResourcesDef: prs,
  		Template:     templates,
  		targetDir:    targetDir,
  	}
  }
docs: // NewSanicServer creates new sanic server from an RAML file