mdtogo

command
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package main generates cobra.Command go variables containing documentation read from .md files. Usage: mdtogo SOURCE_MD_DIR/ DEST_GO_DIR/ [--recursive=true] [--license=license.txt|none]

The command will create a docs.go file under DEST_GO_DIR/ containing string variables to be used by cobra commands for documentation. The variable names are generated from the name of the directory in which the files resides, replacing '-' with ”, title casing the name. All *.md files will be read from DEST_GO_DIR/, including subdirectories if --recursive=true, and a single DEST_GO_DIR/docs.go file is generated.

The content for each of the three variables created per folder, are set by looking for a HTML comment on one of two forms:

<!--mdtogo:<VARIABLE_NAME>-->

..some content..

<!--mdtogo-->

or

<!--mdtogo:<VARIABLE_NAME> ..some content.. -->

The first are for content that should show up in the rendered HTML, while the second is for content that should be hidden in the rendered HTML.

<VARIABLE_NAME> must be suffixed with Short, Long or Examples; <VARIABLE_NAME>s without a prefix will have an assumed prefix of the parent directory of the markdown file.

Flags:

--recursive=true
  Scan the directory structure recursively for .md files
--license
  Controls the license header added to the files.  Specify a path to a license file,
  or "none" to skip adding a license.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL