Skip to main content

Library to dynamically document sh scripts

Project description

Dynamic Doc SH

A dynamic documentation generator to be invoked, using inline tags inspired by Swagger's approach to API documentation.

Overview

When writing shell scripts, documenting them properly can be tedious and often gets overlooked. Dynamic Doc SH solves this problem by allowing you to embed documentation tags directly in your shell scripts, then automatically generating clean, readable Markdown documentation.

Similar to how Swagger generates API documentation from code annotations, this tool parses special tags in your shell scripts and creates comprehensive documentation that stays in sync with your code.

Features

  • Tag-based Documentation: Use simple tags to mark functions, variables, and script sections
  • Automatic Markdown Generation: Generates clean .md files from your tagged shell scripts
  • Dynamic Updates: Documentation stays current with your code changes
  • Multiple Tag Types: Support for different documentation elements
  • Template Generation: Creates consistent documentation structure

How It Works

  • Add tags, place documentation tags directly above the code elements you want to document
  • Run generator, execute the script to parse your shell files
  • Get documentation, lean Markdown documentation is generated/updated automatically

Example

The following example shows all available tags.

#!/bin/bash

set -e

# @doc: Developer settings are used in development mode, don't use it if you deploy in production
# @default: yes
read -e -i yes -p "Use Developer Settings [YES/no]" developer_settings
echo "Developer Settings: $developer_settings"

@doc tag is mandatory if it's not present then the process will be aborted, same for the read directive.

@default is an additional tag that is not mandatory and can be used if needed.

How to run it

dynamicdoc --script_path /tmp/testing_dynamic_doc/default.sh --previous_hash_path /tmp/testing_dynamic_doc
/default_previous_hash_path.txt --output_path /tmp/testing_dynamic_doc/output
  • --script_path, where the script to document is located
  • --previous_hash_path, where the hash history file is located
  • --script_language, specifies which language has been used by the script for the library to be able to use the correct jinja template, bash is the default choice
  • --output_path, where to put the newly created documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dynamic_doc_sh-1.0.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dynamic_doc_sh-1.0.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file dynamic_doc_sh-1.0.1.tar.gz.

File metadata

  • Download URL: dynamic_doc_sh-1.0.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for dynamic_doc_sh-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a648a98b8c976fd690a5433fa621ea5d776970776b2799ff83b95cd7a86c7024
MD5 e1bbb4dab29e68dc8aec1d05920b3c3a
BLAKE2b-256 cd1408372c008143587083c9b8bfc7cf5dce808ee345524cfd82d4899423fbf5

See more details on using hashes here.

File details

Details for the file dynamic_doc_sh-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: dynamic_doc_sh-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for dynamic_doc_sh-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f9248dd6c4ad6da532ae9fbf2de5463ed3a0426c3b8a295649fa70a146e740ff
MD5 8481a54aa911fadbe40fc6b23d5b4800
BLAKE2b-256 19c1ce6e8be5ef6cf3adb076dbbeefb830f7d595263cd298821c03c5ebbae485

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page