1
1
mirror of https://github.com/primer/css.git synced 2024-11-28 22:01:43 +03:00
css/modules/primer-markdown
Emily 2064c1b00b Publish
- primer-alerts@1.5.6
 - primer-avatars@1.5.3
 - primer-base@1.7.1
 - primer-blankslate@1.4.6
 - primer-box@2.5.6
 - primer-branch-name@1.0.4
 - primer-breadcrumb@1.5.2
 - primer-buttons@2.5.4
 - primer-core@6.9.0
 - primer-forms@2.1.1
 - primer-labels@1.5.6
 - primer-layout@1.4.6
 - primer-markdown@3.7.6
 - primer-marketing-buttons@1.0.5
 - primer-marketing-support@1.5.1
 - primer-marketing-type@1.4.6
 - primer-marketing-utilities@1.6.2
 - primer-marketing@6.2.1
 - primer-navigation@1.5.4
 - primer-page-headers@1.4.6
 - primer-page-sections@1.4.6
 - primer-pagination@1.0.0
 - primer-popover@0.1.0
 - primer-product@5.6.3
 - primer-subhead@1.0.4
 - primer-support@4.5.3
 - primer-table-object@1.4.6
 - primer-tables@1.4.6
 - primer-tooltips@1.5.4
 - primer-truncate@1.4.6
 - primer-utilities@4.10.0
 - primer@10.5.0
 - generator-primer-module@1.0.5
 - stylelint-config-primer@2.2.6
 - stylelint-selector-no-utility@1.8.6
2018-05-10 15:31:44 -07:00
..
lib update components to use em spacer variables: 2018-01-05 17:55:47 -05:00
.npmignore rename packages directory to modules 2017-06-29 12:49:16 -07:00
index.scss rename packages directory to modules 2017-06-29 12:49:16 -07:00
LICENSE Happy new year 2018-01-03 15:05:16 -08:00
package.json Publish 2018-05-10 15:31:44 -07:00
README.md Changing shields.io url to https 2017-11-15 10:08:26 -08:00
stories.js adding markdown story to storybook 2017-10-05 15:18:11 -07:00

Primer Markdown

npm version Build Status

Stylesheets for rendering GitHub Flavored Markdown and syntax highlighted code snippets.

This repository is a module of the full primer repository.

Install

This repository is distributed with npm. After installing npm, you can install primer-markdown with this command.

$ npm install --save primer-markdown

Usage

The source files included are written in Sass (scss) You can simply point your sass include-path at your node_modules directory and import it like this.

@import "primer-markdown/index.scss";

You can also import specific portions of the module by importing those partials from the /lib/ folder. Make sure you import any requirements along with the modules.

Build

For a compiled css version of this module, a npm script is included that will output a css version to build/build.css The built css file is also included in the npm package.

$ npm run build

Documentation

Text can be bold, italic, or strikethrough. Links should be blue with no underlines (unless hovered over).

There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs.

There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs. There should be whitespace between paragraphs.

There should be no margin above this first sentence.

Blockquotes should be a lighter gray with a gray border along the left side.

There should be no margin below this final sentence.

Header 1

This is a normal paragraph following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong.

Header 2

This is a blockquote following a header. Bacon ipsum dolor sit amet t-bone doner shank drumstick, pork belly porchetta chuck sausage brisket ham hock rump pig. Chuck kielbasa leberkas, pork bresaola ham hock filet mignon cow shoulder short ribs biltong.

Header 3

This is a code block following a header.

Header 4

  • This is an unordered list following a header.
  • This is an unordered list following a header.
  • This is an unordered list following a header.
Header 5
  1. This is an ordered list following a header.
  2. This is an ordered list following a header.
  3. This is an ordered list following a header.
Header 6
What Follows
A table A header
A table A header
A table A header

There's a horizontal rule above and below this.


Here is an unordered list:

  • Salt-n-Pepa
  • Bel Biv DeVoe
  • Kid 'N Play

And an ordered list:

  1. Michael Jackson
  2. Michael Bolton
  3. Michael Bublé

And an unordered task list:

  • Create a sample markdown document
  • Add task lists to it
  • Take a vacation

And a "mixed" task list:

  • Steal underpants
  • ?
  • Profit!

And a nested list:

  • Jackson 5
    • Michael
    • Tito
    • Jackie
    • Marlon
    • Jermaine
  • TMNT
    • Leonardo
    • Michelangelo
    • Donatello
    • Raphael

Definition lists can be used with HTML syntax. Definition terms are bold and italic.

Name
Godzilla
Born
1952
Birthplace
Japan
Color
Green

Tables should have bold headings and alternating shaded rows.

Artist Album Year
Michael Jackson Thriller 1982
Prince Purple Rain 1984
Beastie Boys License to Ill 1986

If a table is too wide, it should condense down and/or scroll horizontally.

Artist Album Year Label Awards Songs
Michael Jackson Thriller 1982 Epic Records Grammy Award for Album of the Year, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Selling Album, Grammy Award for Best Engineered Album, Non-Classical Wanna Be Startin' Somethin', Baby Be Mine, The Girl Is Mine, Thriller, Beat It, Billie Jean, Human Nature, P.Y.T. (Pretty Young Thing), The Lady in My Life
Prince Purple Rain 1984 Warner Brothers Records Grammy Award for Best Score Soundtrack for Visual Media, American Music Award for Favorite Pop/Rock Album, American Music Award for Favorite Soul/R&B Album, Brit Award for Best Soundtrack/Cast Recording, Grammy Award for Best Rock Performance by a Duo or Group with Vocal Let's Go Crazy, Take Me With U, The Beautiful Ones, Computer Blue, Darling Nikki, When Doves Cry, I Would Die 4 U, Baby I'm a Star, Purple Rain
Beastie Boys License to Ill 1986 Mercury Records noawardsbutthistablecelliswide Rhymin & Stealin, The New Style, She's Crafty, Posse in Effect, Slow Ride, Girls, (You Gotta) Fight for Your Right, No Sleep Till Brooklyn, Paul Revere, Hold It Now, Hit It, Brass Monkey, Slow and Low, Time to Get Ill

Code snippets like var foo = "bar"; can be shown inline.

Also, this should vertically align with this and this.

Code can also be shown in a block element.

var foo = "bar";

Code can also use syntax highlighting.

var foo = "bar";
Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this.
var foo = "The same thing is true for code with syntax highlighting. A single line of code should horizontally scroll if it is really long.";

Inline code inside table cells should still be distinguishable.

Language Code
Javascript var foo = "bar";
Ruby foo = "bar"

Small images should be shown at their actual size.

Large images should always scale down and fit in the content container.

This is the final element on the page and there should be no margin below this.

License

MIT © GitHub