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

docs(usage): Add usage section to docs #759

Merged
merged 1 commit into from
Oct 29, 2016
Merged

docs(usage): Add usage section to docs #759

merged 1 commit into from
Oct 29, 2016

Conversation

lewisblackwood
Copy link
Contributor

This PR includes a 'Usage' section in the documentation, detailing the installation steps for Semantic UI React and the necessary stylesheet to use the project.

For those unfamiliar with component frameworks such as Semantic UI, it would be handy to have this information upfront in the docs. It would allow new users to get started with the React integration as quickly as possible.

I recently joined the Gitter chat to ask a question around this, and saw that a similar question had already been asked a few hours earlier. @levithomason provided some really useful info, which has formed the basis of this page. He also mentioned PRs for new docs were welcome.

Apologies if I've missed anything around contributing - let me know and I'll fix up.

@codecov-io
Copy link

codecov-io commented Oct 28, 2016

Current coverage is 99.48% (diff: 100%)

Merging #759 into master will decrease coverage by <.01%

@@             master       #759   diff @@
==========================================
  Files           134        134          
  Lines          2157       2152     -5   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits           2146       2141     -5   
  Misses           11         11          
  Partials          0          0          

Powered by Codecov. Last update 2c67c87...2069ec6

The Semantic UI React package can be installed via NPM:
</p>
<Segment>
<pre>$ npm install {pkg.name}</pre>
Copy link
Member

Choose a reason for hiding this comment

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

Can we add the --save flag here to remind users to persist the install to their deps?

Since this new page exists, we can also remove the installation instructions from the Introduction page. Do you think we should replace that one with a Setup section that just links to this Usage section?

</p>
<Segment>
<pre>
{'<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.4/semantic.min.css"></link>'}
Copy link
Member

Choose a reason for hiding this comment

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

The doc site uses semantic-ui-css, so we can inject the version number from the package.json here:

// top of the file
const suiCSSVersion = pkg.devDependencies['semantic-ui-css'].replace(/[~^]/, '')

// update template string
{`<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/${suiCSSVersion}/semantic.min.css"></link>`}

This way the instructions always show the same version the doc site itself is running.

* Semantic-UI-CSS package
* -------------------------------------- */}
<Segment basic padded>
<Header as='h2' dividing>Semantic UI CSS package</Header>
Copy link
Member

Choose a reason for hiding this comment

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

This is great. Can we update the headers to have some nesting? Here's an example where I've made JavaScript and CSS as h2s and the three CSS options as h3 and non-dividing:

image

</p>
<Segment>
<pre>
$ npm install semantic-ui-css
Copy link
Member

Choose a reason for hiding this comment

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

Let's also add --save here.

</p>
<Segment>
<pre>
$ npm install semantic-ui
Copy link
Member

Choose a reason for hiding this comment

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

This one should probably be --save-dev given it installs a build system and the final stylesheet is a product of that build.

@levithomason
Copy link
Member

Awesome stuff, thanks! Left a few comments and questions.

@lewisblackwood
Copy link
Contributor Author

Thanks for the comments 👍

I've moved the introduction section around slightly. I wanted to maintain the flow of the feature list and corresponding sections. Let me know if you'd prefer the link to Usage under a separate sub-heading.

@levithomason
Copy link
Member

Perfect. 😸

@levithomason levithomason changed the title Add usage section to docs docs(usage): Add usage section to docs Oct 29, 2016
@levithomason levithomason merged commit 18b60b5 into Semantic-Org:master Oct 29, 2016
@lewisblackwood lewisblackwood deleted the add-usage-docs branch October 29, 2016 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants