Skip to content

Provide code syntax hints/mappings for file extensions #13

@centminmod

Description

@centminmod

Sort of inline with #9 to add a feature to allow users to pair custom file extensions with specific code syntax highlighting.

Right now for my code base, I see code2prompt has a lot of wrapped code in unknown syntax highlighting

```unknown

For example, maybe there's a way to tell code2prompt that *.inc extension files have bash shell scripting so when it comes across *.inc extension files code it wraps it in

```bash

Wasn't sure about how that would be done so asked ChatGPT4o 🤓

  1. Define a Command Line Argument for Mappings: Introduce a new command line argument, such as --syntax-map, which takes a list of mappings.
  2. Specify Mappings in a Clear Format: Use a simple and clear format for specifying each mapping, for example, extension:syntax.
  3. Handle Multiple Mappings: Allow users to specify multiple mappings separated by a comma or provide multiple --syntax-map arguments.
code2prompt --syntax-map "inc:bash,customext:python,ext2:javascript"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions