mirror of
https://github.com/danog/sass-site.git
synced 2024-11-30 04:29:17 +01:00
Simplify helpers
This commit is contained in:
parent
9ac3302fd0
commit
639557c46d
@ -34,6 +34,6 @@
|
||||
|
||||
{%- if details | strip -%}
|
||||
<div class="sl-c-callout sl-c-callout--impl-status">
|
||||
{% if useMarkdown %}{{ details | markdown }}{% else %}{{ details }}{% endif %}
|
||||
{{ details | markdown }}
|
||||
</div>
|
||||
{%- endif -%}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="sl-c-callout sl-c-callout--fun-fact">
|
||||
<h3>💡 Fun fact:</h3>
|
||||
{% if useMarkdown %}{{ contents | markdown }}{% else %}{{ contents }}{% endif %}
|
||||
{{ contents | markdown }}
|
||||
</div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div class="sl-c-callout sl-c-callout--warning">
|
||||
<h3>⚠️ Heads up!</h3>
|
||||
{% if useMarkdown %}{{ contents | markdown }}{% else %}{{ contents }}{% endif %}
|
||||
{{ contents | markdown }}
|
||||
</div>
|
||||
|
@ -36,7 +36,6 @@ interface CompatibilityOptions {
|
||||
node: string | boolean | null;
|
||||
ruby: string | boolean | null;
|
||||
feature: string | null;
|
||||
useMarkdown: boolean;
|
||||
}
|
||||
|
||||
const extend = <
|
||||
@ -64,7 +63,6 @@ const parseCompatibilityOpts = (...args: string[]): CompatibilityOptions => {
|
||||
node: null,
|
||||
ruby: null,
|
||||
feature: null,
|
||||
useMarkdown: true,
|
||||
};
|
||||
const keyValueRegex = /(.*?):(.*)/;
|
||||
for (const arg of args) {
|
||||
|
@ -15,23 +15,18 @@ export {getDocTocData, getToc};
|
||||
* Returns HTML for a fun fact that's not directly relevant to the main
|
||||
* documentation.
|
||||
*/
|
||||
export const funFact = async (contents: string, useMarkdown = true) => {
|
||||
return liquidEngine.renderFile('fun_fact', {
|
||||
export const funFact = async (contents: string) =>
|
||||
liquidEngine.renderFile('fun_fact', {
|
||||
contents: stripIndent(contents),
|
||||
useMarkdown,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns HTML for a heads-up warning related to the main
|
||||
* documentation.
|
||||
* Returns HTML for a heads-up warning related to the main documentation.
|
||||
*/
|
||||
export const headsUp = async (contents: string, useMarkdown = true) => {
|
||||
return liquidEngine.renderFile('heads_up', {
|
||||
export const headsUp = async (contents: string) =>
|
||||
liquidEngine.renderFile('heads_up', {
|
||||
contents: stripIndent(contents),
|
||||
useMarkdown,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns HTML for a code block with syntax highlighting via [Prism][].
|
||||
|
Loading…
Reference in New Issue
Block a user