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

[][xs]: Add the ability to pass a preProcess function #621

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

mohamedsalem401
Copy link
Member

Issue Resolved

Summary

This pull request addresses two specific issues and introduces a valuable enhancement to the Flowershow project. It enables users to add custom functionality before processing files, thus making it more versatile and accommodating for custom plugins or other enhancements.

Details

  1. Custom Pre-Processing Functionality
    Introduced a pre-processing function, preProcess, which allows users to customize the content before further processing. Here is an example of this function:

    export default function preProcess(content) {
      // Replace all occurrences of "=>" with "⟹"
      return content.replace(/=>/g, '⟹');
    }

This enables users to define their own pre-processing logic, such as replacing characters with emojis, adding or removing content, and more.

  1. Issue Auto-convert => and <= and <=> to nicer unicode versions (like obsidian preview does) to avoid errors on build #519
    The introduced changes effectively address Issue #519 by providing a flexible pre-processing step.

  2. Issue [Question] mdxjs error with Days: [[2023-06-22]] <== [[2023-06-23]] ==> [[2023-06-24]] #527
    These changes also resolve Issue #527.

User Customization

The ability to define custom pre-processing logic empowers users to create unique enhancements to Flowershow, like custom plugins or features that were not possible before. This new capability makes Flowershow even more versatile and user-friendly, allowing for a wide range of content transformations.

Copy link

vercel bot commented Jan 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowershow-ssr-r2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 23, 2024 10:38pm

Copy link
Member

@olayway olayway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! But please also:

  1. Describe how to use it in the docs
  2. (Maybe) Add a default pre-processing function that would address the two issues you mentioned (i.e. errors resulting from ==> etc.)

Copy link
Member

@olayway olayway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we merge this now? The docs page is already up.

@mohamedsalem401 mohamedsalem401 merged commit 9b97d85 into main Jan 30, 2024
3 checks passed
@mohamedsalem401 mohamedsalem401 deleted the preProcess branch January 30, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants