Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "doc"

Creates the Documentation

createDoc(params:Params) is the (only) entry point of this module.

Index

Functions

addProjectDescriptions

  • addProjectDescriptions(projects: Projects, params: Params): Promise<any>
  • Enriches each project of the 'projects' object with the property 'repodocDescription'

    Parameters

    • projects: Projects

      an object with enumerable string objects (an object for each project, angular.json structure)

    • params: Params

      parameters for controlling app's run

    Returns Promise<any>

    the projects input object enriched with 'repodocDescription' property for each project/app

    throws no error(s)

createDoc

  • createDoc(params: Params): Promise<string>
  • Creates the Documentation, in detail:

    • creates html file with an entry for each app including

      • a link to app's documentation
      • brief description of the app fetched app's from readme.md
      • other details of the app availabe in the projects file (usually angular.json)
    • copies the documentation of all apps (if desired)

    API/Entry point of that main Repodoc module.

    Parameters

    • params: Params

      Parameter which controls the creation process

    Returns Promise<string>

    nothing (for instance) but consumes the params by logging them to the console

    throws an error if

    • errors arises during creation process in other modules

createHtmlString

  • createHtmlString(template: any, projects: any): Promise<string>
  • Compiles the html template

    Parameters

    • template: any

      compile function

    • projects: any

      projects objects

    Returns Promise<string>

    html string

extractProjectDescription

  • extractProjectDescription(sourceText: string, params: Params): string
  • Extracts app's brief description from a text (which usually comes from app's readme.md).

    Parameters

    • sourceText: string

      The text the function extract the brief description from.

    • params: Params

    Returns string

    App's brief description (if exists)

    throws an error if

    • Chapter '' cannot be not found.

fetchProjectDocs

  • fetchProjectDocs(projectName: string, project: Project, params: Params): Promise<string>
  • Copies apps' docs, if desired (copyProjectsDocs=true is default)

    Prepares the link to the apps' docs. The link will

    • leads either

      • to apps' docs copy, if a copy is desired/exists or
      • to the apps' origine docs
    • not be prepared, if docs of an app do not exist

    Parameters

    • projectName: string

      Name of the project, is part of destination path of a potential copy

    • project: Project

      Object with all project details (see structure of angular.json) particually project's root directory which is also part of destination path of a potential copy

    • params: Params

    Returns Promise<string>

    reference to apps' docs (e.g. projectName) or only projectName, if there are no docs for an app or the docs cannot be copied

    throws no errors

fetchProjectsDocs

  • Enriches each project of the 'projects' object with the property 'repodocReference'

    Calls for each project/app fetchProjectDocs (projectName, project, params) which

    • prepares the reference
    • handles the copying of apps' docs

    Parameters

    • projects: Projects

      Object with all projects (see structure of angular.json)

    • params: Params

    Returns Promise<any>

    the input object 'projects' enriched with with property 'repodocReference' for each project/app

    throws no errors

getProjectDescription

  • getProjectDescription(project: Project, params: Params): Promise<string>
  • Reads the file (usually app's readme.md) containing app's brief description

    Parameters

    Returns Promise<string>

    Either

    • content of the file read of

    • 'no descrption due to missing file' notice, if the file cannot be read

    • 'no description due to ...' notice, if file has unusable content. *

    throws no error(s)

getProjects

  • Extracts all apps/projects from angular.json resp. from a file which contains projects the way angular.json contains.

    Parameters

    Returns Promise<Projects>

    projects with their details

    throws an error if the file

    • cannot be read
    • contains no valid JSON
    • contains no project(s)

getTemplate

  • getTemplate(params: Params): Promise<string>
  • Reads the hbs template file and compiles it.

    Parameters

    Returns Promise<string>

    template creation function

    throws an error if file

    • cannot be read

writeHtmlFile

  • writeHtmlFile(htmlString: string, params: Params): Promise<string>
  • Writes the html code to a file

    Parameters

    • htmlString: string

      html code

    • params: Params

    Returns Promise<string>

    notice 'html file is written to ...'

    throws an error if

    • file cannot be written.

Generated using TypeDoc