markup

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DocumentationBlockKey = regexp.MustCompile(`<\[\w+\]>`) // regex is valid, so the error is ignored

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	// Map where keys are arguments and values are definitions
	Args map[string]string
}

Arguments for documentating code.

type CodeBlock

type CodeBlock struct {
	// Programming language
	Lang string

	// Code
	Snippet string
}

Code snippet (function definition, struct, class, module, i.e.) to be documented.

type Comment

type Comment struct {
	// Name of the comment paragraph, like "Example" in `Example`
	Name string

	// Optional description of the <`Name`> comment
	Description Option[string]

	// Code of the <`Name`> comment
	Code CodeBlock
}

Any other documentation paragraphs.

type Document

type Document struct {
	// File content
	Content string

	// Map of `DocumentationBlock`s
	Blocks map[string]DocumentationBlock
}

Single file structure.

func GenerateEmptyDocumentTemplateIndependent

func GenerateEmptyDocumentTemplateIndependent(plangs []string) Document

Function that generates empty documentation file template.

type DocumentationBlock

type DocumentationBlock struct {
	HashKey     string
	Status      FeatureStatus
	Code        CodeBlock
	Description Option[string]
	Arguments   Arguments
	Examples    []Example
	Comments    []Comment
}

Single documentation block.

Fields are in the following order:

1. `CodeBlock`

2. Description for the `CodeBlock`

3. `Arguments` for the `CodeBlock`

4. List of `Example`s

5. Other `Comment`s

type Example

type Example struct {
	// Optional descripton of the example
	Description Option[string]

	// Code of the example
	Code CodeBlock
}

Usage example.

type FeatureStatus

type FeatureStatus string

Feature status

const (
	// New feature
	New FeatureStatus = "New"

	// Feature is active
	Active FeatureStatus = "Active"

	// Feature is Deprecated
	Deprecated FeatureStatus = "Deprecated"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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