mdtogo

command module
v0.0.0-...-909caaa Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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