Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom extension mapping #14

Merged
merged 4 commits into from
Dec 19, 2024
Merged

Custom extension mapping #14

merged 4 commits into from
Dec 19, 2024

Conversation

treycucco
Copy link
Collaborator

Overview

Adds the ability to provide a custom extension to code type mapping.

Background

Currently the code blocks are tagged with the extension of the file they come from. For instance if there is a best practices block in a .tsx (TypeScript JSX) file, the code block will be

```tsx
// code block
```

However some documentation systems might not recognize tsx as a valid type and instead want a simple `ts'

Description

This PR adds a way to define extension-to-code-type mappings on the command line via the -m, --extension-mappings CLI argument, such as:

-m tsx:ts jsx:js

This will cause .tsx file code blocks to have a ts type, and jsx file code blocks to have a js type.

@treycucco treycucco requested a review from maxpollack December 19, 2024 17:45
@treycucco treycucco merged commit 9aac78c into main Dec 19, 2024
2 checks passed
@treycucco treycucco deleted the custom-extension-mapping branch December 19, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants