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

Pass description in sections #743

Merged
merged 3 commits into from Dec 19, 2017
Merged

Pass description in sections #743

merged 3 commits into from Dec 19, 2017

Conversation

SaraVieira
Copy link
Collaborator

@SaraVieira SaraVieira commented Dec 19, 2017

In the project I am currently in we want to show section descriptions in the header of the section.

Also changed one of the styleguide configs to show this

Is this okay ?

@SaraVieira
Copy link
Collaborator Author

docs changed

Copy link
Member

@sapegin sapegin left a comment

Choose a reason for hiding this comment

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

Thanks, looks useful!

return (
<section className={classes.root}>
{name && (
<SectionHeading depth={depth} id={slug} slotName="sectionToolbar" slotProps={allProps}>
{name}
</SectionHeading>
)}
{description && <Markdown text={`${description}`} inline />}
Copy link
Member

Choose a reason for hiding this comment

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

  1. Why is it inline? Shouldn’t it be rendered on its own line with a proper whitespace below?
  2. I think just text={description} will be enough.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yor are right about both and changed :)


const contentJsx = content && <Examples examples={content} name={name} />;
const componentsJsx = components && <Components components={components} depth={depth + 1} />;
const sectionsJsx = sections && <Sections sections={sections} depth={depth + 1} />;

return (
<SectionRenderer
description={description}
Copy link
Member

Choose a reason for hiding this comment

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

I think you need to update PropTypes of SectionRenderer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done , sorry :)

@codecov-io
Copy link

codecov-io commented Dec 19, 2017

Codecov Report

Merging #743 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted Files Coverage Δ
loaders/utils/getSections.js 100% <ø> (ø) ⬆️
src/rsg-components/Section/SectionRenderer.js 100% <100%> (ø) ⬆️
src/rsg-components/Section/Section.js 100% <100%> (ø) ⬆️

@sapegin sapegin added this to the 6.2.0 milestone Dec 19, 2017
@SaraVieira
Copy link
Collaborator Author

So we got them Node 4 failing again :(

@sapegin
Copy link
Member

sapegin commented Dec 19, 2017

Try to merge master, I’ve made it optional.

@SaraVieira
Copy link
Collaborator Author

Passed 😍

@sapegin sapegin merged commit eeec955 into master Dec 19, 2017
@sapegin sapegin deleted the description branch December 19, 2017 19:19
@sapegin
Copy link
Member

sapegin commented Dec 19, 2017

:shipit:

sapegin added a commit that referenced this pull request Jan 21, 2018
## New features

* New option `editorConfig` to change CodeMirror options (#648, [#662](#662) by @SaraVieira)
* Allow descriptions for sections ([#743](#743) by @SaraVieira)
* Add TypeScript files to default components and ignore patterns ([#749](#749), part of [#750](#750))

## Bug fixes

* Fix global access to all components in isolation mode ([#738](#738))
* Fix color issue in Safari ([#739](#739))
* Allow overriding of renderer-only components ([#710](#710))
* Do not overflow floated elements in examples (#772, [#773](#773) by @roblevintennis)
* HTML escaping in Add example block ([#741](#741))
* Fix infinite loop caused by markdown-to-jsx ([#742](#742))
sapegin added a commit that referenced this pull request Jan 21, 2018
## New features

* New option `editorConfig` to change CodeMirror options (#648, [#662](#662) by @SaraVieira)
* Allow descriptions for sections ([#743](#743) by @SaraVieira)
* Add TypeScript files to default components and ignore patterns ([#749](#749), part of [#750](#750))

## Bug fixes

* Fix global access to all components in isolation mode ([#738](#738))
* Fix color issue in Safari ([#739](#739))
* Allow overriding of renderer-only components ([#710](#710))
* Do not overflow floated elements in examples (#772, [#773](#773) by @roblevintennis)
* HTML escaping in Add example block ([#741](#741))
* Fix infinite loop caused by markdown-to-jsx ([#742](#742))
sapegin added a commit that referenced this pull request Jan 21, 2018
## New features

* New option `editorConfig` to change CodeMirror options (#648, [#662](#662) by @SaraVieira)
* Allow descriptions for sections ([#743](#743) by @SaraVieira)
* Add TypeScript files to default components and ignore patterns ([#749](#749), part of [#750](#750))

## Bug fixes

* Fix global access to all components in isolation mode ([#738](#738))
* Fix color issue in Safari ([#739](#739))
* Allow overriding of renderer-only components ([#710](#710))
* Do not overflow floated elements in examples (#772, [#773](#773) by @roblevintennis)
* HTML escaping in Add example block ([#741](#741))
* Fix infinite loop caused by markdown-to-jsx ([#742](#742))
artem0723 pushed a commit to artem0723/React-Styleguidist that referenced this pull request Oct 28, 2021
## New features

* New option `editorConfig` to change CodeMirror options (#648, [#662](styleguidist/react-styleguidist#662) by @SaraVieira)
* Allow descriptions for sections ([#743](styleguidist/react-styleguidist#743) by @SaraVieira)
* Add TypeScript files to default components and ignore patterns ([#749](styleguidist/react-styleguidist#749), part of [#750](styleguidist/react-styleguidist#750))

## Bug fixes

* Fix global access to all components in isolation mode ([#738](styleguidist/react-styleguidist#738))
* Fix color issue in Safari ([#739](styleguidist/react-styleguidist#739))
* Allow overriding of renderer-only components ([#710](styleguidist/react-styleguidist#710))
* Do not overflow floated elements in examples (#772, [#773](styleguidist/react-styleguidist#773) by @roblevintennis)
* HTML escaping in Add example block ([#741](styleguidist/react-styleguidist#741))
* Fix infinite loop caused by markdown-to-jsx ([#742](styleguidist/react-styleguidist#742))
artem0723 pushed a commit to artem0723/React-Styleguidist that referenced this pull request Oct 28, 2021
## New features

* New option `editorConfig` to change CodeMirror options (#648, [#662](styleguidist/react-styleguidist#662) by @SaraVieira)
* Allow descriptions for sections ([#743](styleguidist/react-styleguidist#743) by @SaraVieira)
* Add TypeScript files to default components and ignore patterns ([#749](styleguidist/react-styleguidist#749), part of [#750](styleguidist/react-styleguidist#750))

## Bug fixes

* Fix global access to all components in isolation mode ([#738](styleguidist/react-styleguidist#738))
* Fix color issue in Safari ([#739](styleguidist/react-styleguidist#739))
* Allow overriding of renderer-only components ([#710](styleguidist/react-styleguidist#710))
* Do not overflow floated elements in examples (#772, [#773](styleguidist/react-styleguidist#773) by @roblevintennis)
* HTML escaping in Add example block ([#741](styleguidist/react-styleguidist#741))
* Fix infinite loop caused by markdown-to-jsx ([#742](styleguidist/react-styleguidist#742))
artem0723 pushed a commit to artem0723/React-Styleguidist that referenced this pull request Oct 28, 2021
## New features

* New option `editorConfig` to change CodeMirror options (#648, [#662](styleguidist/react-styleguidist#662) by @SaraVieira)
* Allow descriptions for sections ([#743](styleguidist/react-styleguidist#743) by @SaraVieira)
* Add TypeScript files to default components and ignore patterns ([#749](styleguidist/react-styleguidist#749), part of [#750](styleguidist/react-styleguidist#750))

## Bug fixes

* Fix global access to all components in isolation mode ([#738](styleguidist/react-styleguidist#738))
* Fix color issue in Safari ([#739](styleguidist/react-styleguidist#739))
* Allow overriding of renderer-only components ([#710](styleguidist/react-styleguidist#710))
* Do not overflow floated elements in examples (#772, [#773](styleguidist/react-styleguidist#773) by @roblevintennis)
* HTML escaping in Add example block ([#741](styleguidist/react-styleguidist#741))
* Fix infinite loop caused by markdown-to-jsx ([#742](styleguidist/react-styleguidist#742))
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.

None yet

3 participants