Skip to content

declared-md/validator

Repository files navigation

declared-md

Validate, initialize, and preview declared-md profile files.

Three commands for the three declared-md standards: whoami.md, whois.md, and whatis.md.

install

npm install -g declared-md

Or use without installing:

npx declared-md <command>

commands

init

Create a new profile file in the current directory. The command asks for required fields interactively and writes the file.

npx declared-md init whoami
npx declared-md init whois
npx declared-md init whatis

For whoami, you can optionally prefill name, location, and links from a public GitHub profile.

validate

Validate a file against its schema. Auto-detects the file in the current directory if no path is given.

npx declared-md validate
npx declared-md validate ./whoami.md
npx declared-md validate ./path/to/whois.md

Exit codes:

  • 0 valid
  • 1 invalid (schema errors)
  • 2 CLI error (file not found, parse error, etc.)

Example output for an invalid file:

invalid whoami.md

  x handle: must be 2-39 characters, lowercase letters, numbers, and hyphens only
  x links.site: must be a valid HTTPS URL (must start with https://)
  x status: must be one of: open-to-work, working, building, learning, unavailable

3 errors found.

preview

Start a local HTTP server that renders a preview of the profile. Opens the browser automatically. Reloads when the file changes.

npx declared-md preview
npx declared-md preview ./whoami.md

The preview runs on http://localhost:3939. Press ctrl+c to stop.

The file is validated before the preview starts. If it is invalid, errors are shown and the server does not start.

spec

The full specification is at declared-md.github.io.

JSON Schemas are in the declared-md/spec repository under schemas/.

license

MIT

About

Official spec validator for declared-md.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors