This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
276 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ | |
img(src=image.image[0] alt=image.caption) | ||
if image.caption | ||
figcaption!= marked(image.caption) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,73 @@ | ||
const React = require('react'); | ||
import Marked from '../lib/marked'; | ||
|
||
const CallOut = ({block}) => { | ||
const c = block.data.title ? '' : 'no-title'; | ||
|
||
return ( | ||
<div className={`magic-block-callout type-${block.data/type} ${c} `}> | ||
<div className={`magic-block-callout type-${block.data.type} ${c} `}> | ||
{ | ||
(block.data.title) && ( | ||
<h3> | ||
{ | ||
(block.data.type === 'info') && ( | ||
<i className="fa fa-info-circle" title="Info"></i> | ||
<i className="fa fa-info-circle" title="Info"/> | ||
) | ||
} | ||
|
||
{ | ||
(block.data.type ==='warning') && ( | ||
<i className="fa fa-exclamation-circle" title="Warning"></i> | ||
<i className="fa fa-exclamation-circle" title="Warning"/> | ||
) | ||
} | ||
|
||
{ | ||
(block.data.type ==='danger') && ( | ||
<i className="fa fa-exclamation-triangle" title="Danger"></i> | ||
<i className="fa fa-exclamation-triangle" title="Danger"/> | ||
) | ||
} | ||
|
||
{ | ||
(block.data.type ==='success') && ( | ||
<i className="fa fa-check-square" title="Success"></i> | ||
<i className="fa fa-check-square" title="Success"/> | ||
) | ||
} | ||
|
||
{block.data.title} | ||
</h3> | ||
|
||
(!block.data.title) && ( | ||
<span className="noTitleIcon"> | ||
{ | ||
(block.data.type ==='info') && ( | ||
<i className="fa fa-info-circle" title="Info"></i> | ||
) | ||
} | ||
|
||
{ | ||
(block.data.type ==='warning') && ( | ||
<i className="fa fa-exclamation-circle" title="Warning"></i> | ||
) | ||
} | ||
|
||
{ | ||
(block.data.type ==='danger') && ( | ||
<i className="fa fa-exclamation-triangle" title="Danger"></i> | ||
) | ||
} | ||
(!block.data.title) && ( | ||
<span className="noTitleIcon"> | ||
{ | ||
(block.data.type ==='info') && ( | ||
<i className="fa fa-info-circle" title="Info"/> | ||
) | ||
} | ||
|
||
{ | ||
(block.data.type ==='success') && ( | ||
<i className="fa fa-check-square" title="Success"></i> | ||
) | ||
} | ||
{ | ||
(block.data.type ==='warning') && ( | ||
<i className="fa fa-exclamation-circle" title="Warning"/> | ||
) | ||
} | ||
|
||
</span> | ||
) | ||
{ | ||
(block.data.type ==='danger') && ( | ||
<i className="fa fa-exclamation-triangle" title="Danger"/> | ||
) | ||
} | ||
|
||
(block.data && block.data.body) && ( | ||
<div className="callout-body" dangerouslySetInnerHTML={Marked(block.data.body)}></div> | ||
) | ||
} | ||
{ | ||
(block.data.type ==='success') && ( | ||
<i className="fa fa-check-square" title="Success"/> | ||
) | ||
} | ||
</span> | ||
) | ||
(block.data && block.data.body) && ( | ||
<div className="callout-body"> {block.data.body}</div> | ||
) | ||
)} | ||
</div> | ||
) | ||
); | ||
}; | ||
|
||
module.exports = CallOut; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,59 @@ | ||
const syntaxHighlighter = require('../../../readme-syntax-highlighter'); | ||
const getLangName = require('../lib/generate-code-snippets'); | ||
|
||
const BlockCode = ({data, opts}) => { | ||
(!data || !data.codes || data.codes.length === 0 || data.codes[0].code === '' || data.codes[0].code ==='{}') && ( | ||
opts = opts || {}; | ||
opts = opts || {}) | ||
|
||
(opts.label) && ( | ||
<label> | ||
{opts.label} | ||
</label> | ||
) | ||
|
||
<div className="magic-block-code"> | ||
(<div className="magic-block-code"> | ||
(!opts.hideHeaderOnOne || data.codes.length > 1) && ( | ||
<ul className="block-code-header"> | ||
for (code, i in data.codes) { | ||
<li> | ||
<a href="" onClick={`showCode${i}`} style={`active: ${i === 'tab'} `}> | ||
{ (() => { | ||
switch(code) { | ||
case code.status : return ( | ||
<span className={`status-icon status-icon-${statusCodes(code.status)[2]}`}> | ||
data.codes.map((code, i) => { | ||
<li> | ||
<a href="" onClick={`showCode${i}`} style={`active: ${i === 'tab'} `}> | ||
{ (() => { | ||
switch(code) { | ||
case code.status : return ( | ||
<div> | ||
<span className={`status-icon status-icon-${statusCodes(code.status)[2]}`}> | ||
(!statusCodes(code.status)[3]) && ( | ||
{statusCodes (code.status)[0]} | ||
) | ||
</span> | ||
<em> | ||
{code.name ? code.name : statusCodes(code.status)[1]} | ||
</em> | ||
) | ||
default: return ( | ||
switch(code) { | ||
case code.name : return ( | ||
{code.name} | ||
) | ||
default: return ( | ||
|
||
) | ||
} | ||
{statusCodes (code.status)[0]} | ||
) | ||
</span> | ||
<em> | ||
{code.name ? code.name : statusCodes(code.status)[1]} | ||
</em> | ||
</div> | ||
) | ||
default: return | ||
switch(code) { | ||
case code.name : return | ||
{code.name} | ||
default: return | ||
{getLangName(code.language)} | ||
} | ||
}) () | ||
} | ||
</a> | ||
</li> | ||
} | ||
} | ||
}) ()} | ||
</a> | ||
</li> | ||
}) | ||
</ul> | ||
) | ||
|
||
<div className="block-code-code"> | ||
for (code, i in data.codes) { | ||
data.codes.map((code, i)=> { | ||
<pre> | ||
<code dangerouslySetInnerHTML={syntaxHighlighter(code.code, code.language, opts.dark)}></code> | ||
<code>{syntaxHighlighter(code.code, code.language, opts.dark)}</code> | ||
</pre> | ||
} | ||
</div> | ||
</div> | ||
) | ||
</div>) | ||
}; | ||
|
||
module.exports = BlockCode; |
Oops, something went wrong.