question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSF3: Programmatic Title Generation

See original GitHub issue

From what I read, the CSF3 automatic title generation is based on the path and a potential prefix to it? I see, this might work for some frameworks but surely not for all. Also monorepos with workspaces might be affected by this (unless you name each package explcitely - which you don’t want, because you choose the workspaces already).

An idea to give an options where the existing generation is not feasible is to provide a generation function, this signature:

function generateStoryTitle(path: string): string;

A function that takes the path as input and returns the title of the story. I can see that in either .storybook/preview.ts (more likely here) or .storybook/main.ts.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
steven-prybylynskyicommented, Sep 15, 2021

Downgraded to alpha35 and it works again. One suggestion though

In our codebase files are structured in a way that all component-related files (component, unit tests, stories, helpers) that belong together are placed in a single folder

With the automatic title generation we have this structure with unnecessary duplication of the component name, e.g. Navbar/Navbar instead of just Navbar

image

3reactions
lunelsoncommented, Jan 5, 2022

With the automatic title generation we have this structure with unnecessary duplication of the component name, e.g. Navbar/Navbar instead of just Navbar

This was my first observation when I tried this feature too. I would prefer to have a function option that receives the title (whether a generated one, or a declared one; along with a flag to indicate which) and which then could modify it:

module.exports = {
  stories: [
    {
      directory: '/some/path',
      titleFn(title, isAutoGenerated) {
        return !isAutoGenerated ? title : title.replace(/\/\w+$/, '');
      },
      files: '*.somepattern.whatever',
    },
  ],
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

CSF3 colony stimulating factor 3 [Homo sapiens (human)]
Title : M2 macrophage-derived G-CSF promotes trophoblasts EMT, invasion and migration via activating PI3K/Akt/Erk1/2 pathway to mediate normal ...
Read more >
[1608.07068] Title Generation for User Generated Videos - arXiv
Our framework allows for jointly training a model for title generation and video highlight localization. Second, we induce high sentence ...
Read more >
Bulk Generating Page Titles in Google Sheets (and Excel!)
Need to generate tens, hundreds, or thousands of page titles? Here's the solution that you've been looking for!
Read more >
CSF3 Gene - GeneCards | CSF3 Protein | CSF3 Antibody
Complete information for CSF3 gene (Protein Coding), Colony Stimulating Factor 3, ... VectorBuilder Stable cell line generation for CSF3.
Read more >
18 Free Title Generator Tools for Writing Better Headlines
Title generator tools help you write engaging, SEO-friendly headlines. Try these 18 free options to improve your blog and webpage titles.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found