Make cheatsheet testable.

This commit is contained in:
Sander Spies 2020-03-19 21:27:58 +01:00
parent ebbaccd064
commit 7896de89f3
3 changed files with 989 additions and 140 deletions

File diff suppressed because it is too large Load Diff

View File

@ -166,7 +166,7 @@ export default ({children, className: languageClassName, metastring}) => {
{showCopied ? 'Copied' : 'Copy'} {showCopied ? 'Copied' : 'Copy'}
</button> </button>
<code ref={target} className={styles.codeBlockLines} style={style}> <code ref={target} className={styles.codeBlockLines}>
{tokens.map((line, i) => { {tokens.map((line, i) => {
if (line.length === 1 && line[0].content === '') { if (line.length === 1 && line[0].content === '') {
line[0].content = '\n'; // eslint-disable-line no-param-reassign line[0].content = '\n'; // eslint-disable-line no-param-reassign

View File

@ -989,21 +989,43 @@ a:hover {
} }
} }
/* ReasonLIGO specific syntax highlighting */
.language-reasonligo .hljs-operator {
color: #a626a4;
}
.language-reasonligo .hljs-character {
color: #50a14f;
}
.language-reasonligo .hljs-module-identifier {
color: #00f;
}
.language-reasonligo .hljs-constructor {
color: #a31515;
}
.badge { .badge {
display: none; display: none;
} }
.codeTable {
display: grid;
grid-template-columns: 30% 70%;
align-items: center;
}
.codeTable > .primitive {
width: 100%;
height: 100%;
display: flex;
justify-content: right;
text-align: right;
align-items: center;
font-weight: bold;
padding-right: 1rem;
}
.codeTable > div:nth-child(4n+1) {
background-color: var(--ifm-table-stripe-background);
}
.codeTable > div:nth-child(4n+2) {
background-color: var(--ifm-table-stripe-background);
}
.codeTable > .example {
padding-top: var(--ifm-leading);
}
.codeTable > .example pre,
.codeTable > .example .codeBlockLines_src-theme-CodeBlock- {
background-color: transparent;
}