Skip to content

[Feature request] change cargo about init to generate the statement including user's project name. #281

@kyu08

Description

@kyu08

Thank you for always maintaining cargo-about! This tool makes license management for cargo project much easier.

If you agree with my proposal, I can submit a PR.

Is your feature request related to a problem? Please describe.

For now, the file generated by cargo about init includes the following lines.

        <div class="intro">
            <h1>Third Party Licenses</h1>
            <p>This page lists the licenses of the projects used in cargo-about.</p>
        </div>

Users should rename cargo-about to their own project name, because the above means a file generated by cargo about generate shows cargo-about's third party licenses. (Unfortunately, lots of users do not change this part.)

If cargo-about could do this automatically, it would be more user-friendly.

Describe the solution you'd like

I propose to change cargo about init to generate the statement including user's project name.

        <div class="intro">
            <h1>Third Party Licenses</h1>
            <p>This page lists the licenses of the projects used in your-project-name.</p>
        </div>

Describe alternatives you've considered

N/A

How to implement

  1. Change cargo-about to {{project_name}} in This page lists the licenses of the projects used in cargo-about. in default.hbs.
  2. Replace {{project_name}} with actual project name in init command.
    1. Retrive actual project name using krates::cm::MetadataCommand::new().exec()?.root_package()?.name; here.
    2. Replace {{project_name}} with the actual project name using Handlebars like this.

It might be too much to use Handlebars for this. If so, it might be better to use just str::replace or something instead of Handlebars.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions