web

package
v0.4.28 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

This is a simple web-server for re-formatting PSV tables.

Routes:

GET /index.html

    +---------------------------+
    | (reformat|reset|show-all) |
    |                           |
    | [ ] align [x] squash      |
    | prefix: [//___]           |
    | locale: [en___]           |
    | style:  [markdown|v]      |
    |                           |
    | +- input ---------------+ |
    | |                       | |
    | |                       | |
    | +-----------------------+ |
    +---------------------------+

GET /api/tour

    {
        tutorials: [
                       { ... },
                       { ... }
                   ]
    }

POST /api/format
    accept text input
        - TODO: 2025-03-27
            - [ ] limit size
            - [ ] limit # api calls per IP
    response
        - [x] text (reformatted input)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer(ctx context.Context, addr string)

TODO: 2026-02-11 watch context for quit signal

Types

type ReformatJSON

type ReformatJSON struct {
	Text     string `json:"text"`     // the text to be re-formatted
	Commands string `json:"commands"` // space separated command(s) (sort, insert ..., move ..., delete ...)
	// deprecated - prefix, profile & locale can all be provided via commands
	Prefix  string `json:"prefix"`  // an optional prefix pattern (symbols)
	Profile string `json:"profile"` // profile name (psv, markdown, gherkin, ...)
	Locale  string `json:"locale"`  // locale tag, (en, de, dk, se, ...)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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