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

Introduce a pretty generator #1

Closed
wants to merge 1 commit into from
Closed

Introduce a pretty generator #1

wants to merge 1 commit into from

Conversation

arthurfiorette
Copy link
Member

@arthurfiorette arthurfiorette commented Jul 31, 2023

Having the option to quick switch between production(minified, default) and pretty(easy for debug) would be an awesome feature, since, for now you have to install another package for it.

Tasklist:

  • Include tests for the prettifier
  • Fixed pretty.d.ts file to correct export types
  • Change documentation to on how changing import html from '@kitajs/html' to import html from '@kitajs/html/pretty' makes the entire file generate prettified html.
  • Improve formatter (?) Maybe we should just keep things simple to only help debugging and hardcode default options to avoid this having infinite issues about custom formatting options we should add.
  • Include benchmark results for this feature (And probably warn users that this will be slower than the normal one, but compiled results should be the same)

I'm not needing this feature for now, thus I will not give it any priority, this is why I opened this PR. If you want to work on this, just give me a heads up!

@arthurfiorette arthurfiorette added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jul 31, 2023
@arthurfiorette arthurfiorette self-assigned this Jul 31, 2023
@arthurfiorette arthurfiorette marked this pull request as draft July 31, 2023 17:29
@arthurfiorette
Copy link
Member Author

I'll be closing this PR as there's no real reason for it... If someone actually needs it, there's already a section on our documentation about it.

@hbendev
Copy link

hbendev commented Nov 29, 2023

Hey! Thanks for the lib!

For anyone looking to format the output of @kitajs/html when using Storybook - because it actually makes sense there -, here's what to do in your preview.ts/js file:

/** @type { import('@storybook/html').Preview } */
export const preview = {
  parameters: {
    // ...
    docs: {
      source: {
        format: "html"
      },
    },
    // ...
  },
};

export default preview;

Assuming you're on Storybook version 7. Related docs: https://storybook.js.org/docs/api/doc-block-source#format

@arthurfiorette arthurfiorette deleted the pretty branch April 3, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants