Skip to content

πŸ—ΊοΈ Be able to export a Taskfile to markdown documentation w. mermaid dependency graph πŸ“ Β #2503

Description

@adriens

Description

❔ About

I use task a lot, and someimes, I feel the need to :

  • ➿ Automate documentation (for example within a CI pipeline)
  • πŸ—£οΈ Share a task file to non-programmers to explain them a workflow I implemented with task

πŸ‘‰ I only need to export a kind of javadoc or taskdoc

πŸ’‘ The idea

In addition to --list option, would it possible to add the --markdown option so we could get that kind of md output :


Taskfile Workflow Diagram

This diagram visualizes the dependencies and flow between tasks defined in Taskfile.yml :

graph TD
    default["**default**"]:::defaultNode -- deps --> generate["generate"]
    default -- deps --> generate-webp["generate-webp"]
    default -- deps --> optimize["optimize"]
    generate -- deps --> setup["setup"]
    clean["clean"]
    pdf-logo["pdf-logo"]

    classDef defaultNode fill:#1976D2,color:#fff,stroke:#333,stroke-width:2px;
Loading

Task Goals and Descriptions

Task Name Description
default This Taskfile dynamically creates PNG and JPEG image assets from SVG source files. Run 'task generate' to create them.
setup Check for required tools (svgexport, convert, optipng, jpegoptim)
generate Generate PNG and JPEG versions of the logos from SVG files
clean Remove all generated files
pdf-logo Compile the LaTeX logo into a PDF and clean up auxiliary files
generate-webp Generate WebP versions of the logos from PNG files
optimize Optimize the size of generated PNG and JPEG files

Copy and paste the Mermaid code into a Markdown viewer that supports Mermaid to see the graph rendered visually.

πŸ”­ Further with dot / graphviz option

Like terraform makes it possible, maybe add the option to export to dot / graphviz

Activity

  1. changed the title [-]πŸ—ΊοΈ Be able to export a Taskfile to `markdown` documentation w. `mermaid` dependcy graph[/-] [+]πŸ—ΊοΈ Be able to export a Taskfile to `markdown` documentation w. `mermaid` dependency graph[/+] on Nov 10, 2025
  2. changed the title [-]πŸ—ΊοΈ Be able to export a Taskfile to `markdown` documentation w. `mermaid` dependency graph[/-] [+]πŸ—ΊοΈ Be able to export a Taskfile to `markdown` documentation w. `mermaid` dependency graph πŸ“ [/+] on Nov 10, 2025
  3. trulede commented on Nov 10, 2025

    @trulede
    Contributor

    You might find this PR interesting #2348, its possible to geneate documentation in any format you want - including MD Doc.

  4. adriens commented on Nov 11, 2025

    @adriens
    Author
  5. added a commit that references this issue on Nov 12, 2025
  6. adriens commented on Nov 12, 2025

    @adriens
    Author

    You might find this PR interesting #2348, its possible to geneate documentation in any format you want - including MD Doc.

    That inspired me @trulede

    Made a first try and it seems like it's working , see
    https://github.com/adriens/task-gomplates

  7. adriens commented on Nov 12, 2025

    @adriens
    Author

    I gave it a try on your taskfile (website) :

    1. Download the Taskfile and the template file

      # Download the Taskfile
      curl -L https://github.com/go-task/task/raw/main/website/Taskfile.yml -o Taskfile.yml
      
      # Download the gomplate template
      curl -L https://github.com/adriens/task-gomplates/raw/main/tmpl/task-to-md-mermaid.gomplate -o task-to-md-mermaid.gomplate
    2. Generate the Markdown Documentation

      gomplate -f task-to-md-mermaid.gomplate -d tasks=Taskfile.yml > Taskfile.md

    See by yourself below πŸ‘‡


    Taskfile Workflow Diagram

    This content was generated thanks to adriens/task-gomplates.
    This diagram visualizes the dependencies and flow between tasks defined in Taskfile.yml :

    graph TD
        build[build]
        clean[clean]
        default["**default**"]:::defaultNode
        deploy:next[deploy:next]
        deploy:prod[deploy:prod]
        install[install]
        lint[lint]
        preview[preview]
        build -- deps --> install
        default -- deps --> install
        lint -- deps --> install
        preview -- deps --> build
    
        classDef defaultNode fill:#1976D2,color:#fff,stroke:#333,stroke-width:2px;
    
    Loading

    Task Goals and Descriptions

    Task Name Description
    build Build website
    clean Clean temp directories
    default Start website
    deploy:next Build and deploy next.taskfile.dev
    deploy:prod Build and deploy taskfile.dev
    install Setup VitePress locally
    lint Lint website
    preview Preview Website
  8. adriens commented on Nov 12, 2025

    @adriens
    Author

    Properly documented here

  9. trulede commented on Nov 12, 2025

    @trulede
    Contributor

    @adriens very cool!

    not my site though πŸ˜‰

  10. adriens commented on Nov 12, 2025

    @adriens
    Author

    @adriens very cool!

    not my site though πŸ˜‰

    Do you have a taskfile to build yours ?

  11. converted this issue into a discussion #2549 on Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions