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.

Cleaner way to define sections

See original GitHub issue

Just thinking aloud here: wouldn’t it be much easier to use the folder structure to define sections in the styleguide instead of using globs in the config file? For example, I currently have:

- components
| - ShareButton
| - AcquisitionButton
| - etc

But it’d be great if I could add a section to the sidebar by just grouping these buttons in its own button folder:

- components
| - Buttons
  | - ShareButton
  | - AcquisitionButton
| - etc

Would be happy to draft a PR if this is a viable option

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mik01ajcommented, Aug 9, 2016

I find it ok, but I’d say that currently configuring the cestions is not a problem for me. I have a styleguide with 120 examples, and my sections config is as simple as:

sections: [
    {name: 'Introduction', content: './introduction.md'},
    {name: 'Core UI', components: '../core/[A-Z]*/index.jsx'},
    {name: 'Generic UI & partials', components: '../ui/[A-Z]*/index.jsx'},
    {name: 'Dialogs', components: '../dialogs/[A-Z]*/index.jsx'},
    {name: 'Pages', components: '../pages/[A-Z]*/index.jsx'},
    {name: 'Admin UI', components: '../adminUi/[A-Z]*/index.jsx'},
],

And btw - think also about md-only sections (like the introduction in my case). I don’t want to put it in a new folder, so it looks like some config is still unavoidable.

And I’d also suggest that you write some full examples here, I mean: example file structures and the expected output. Then we could refine this before you even start coding. 😃

2reactions
mik01ajcommented, Aug 8, 2016

Good idea, but how would you specify section titles and additional docs (md) then?

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 Ways to Write Cleaner Code - Pluralsight
For example, grouping them all by what they are is a good way to go. It's quite likely that you'll have several types...
Read more >
25 Expert Tips for Cleaner CSS Coding for WordPress
25 Expert Tips for Cleaner CSS Coding for WordPress · 1. Figure Out Your Layout · 2. Code with Future Reviewers in Mind...
Read more >
How to Section Your HTML | CSS-Tricks
Instead, make the sidebar a single <aside> and then use <section> (or another appropriate sectioning element) to create the different sections.
Read more >
Using sections to control page numbers, headers and footers
Using sections to control page numbers, headers and footers · Insert section breaks between the pages where the pagination style will change. ·...
Read more >
Microsoft Word - Sections with Headers and Footers - YouTube
This video will show you how to use sections breaks with headers and footers. Section breaks allow you to set up a document...
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