Class: Makit::Cli::Generators::Templates::Rust::Readme

Inherits:
Object
  • Object
show all
Defined in:
lib/makit/cli/generators/templates/rust_templates.rb

Overview

Template for generating README.md documentation

This template creates project documentation with standard sections for building, running, and testing the Rust project.

Instance Method Summary collapse

Constructor Details

#initialize(project_name) ⇒ Readme

Initialize the README.md template

Parameters:

  • project_name (String)

    Name of the Rust project



68
69
70
# File 'lib/makit/cli/generators/templates/rust_templates.rb', line 68

def initialize(project_name)
  @project_name = project_name
end

Instance Method Details

#renderString

Render the README.md file content

Returns:

  • (String)

    Markdown documentation for the Rust project



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/makit/cli/generators/templates/rust_templates.rb', line 75

def render
  <<~README
    # #{@project_name}

    A Rust project.

    ## Building

    ```bash
    cargo build
    ```

    ## Running

    ```bash
    cargo run
    ```

    ## Testing

    ```bash
    cargo test
    ```
  README
end