-
Notifications
You must be signed in to change notification settings - Fork 212
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
9 changed files
with
422 additions
and
28 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: Writing Codewars Docs | ||
--- | ||
|
||
The Codewars Docs is built with [Docusaurus][docusaurus]. You can write docs using Markdown. Docusaurus provides some [extensions][markdown-features] to make writing docs easier, and we can also use [MDX][mdx] to extend Markdown with React components. | ||
|
||
This page summarizes the features and also used to test the styling. | ||
|
||
See [Docusaurus Docs][docusaurus-docs] for more details. | ||
|
||
## Admonitions | ||
|
||
Use the following syntax to add admonitions: | ||
|
||
```markdown | ||
:::type title? | ||
|
||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
|
||
::: | ||
``` | ||
|
||
`type` is required. `title` is optional and defaults to uppercased `type`. | ||
|
||
### Types | ||
|
||
:::note | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation. | ||
::: | ||
|
||
:::tip | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation. | ||
::: | ||
|
||
:::info | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation. | ||
::: | ||
|
||
:::warning | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation. | ||
::: | ||
|
||
:::caution | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation. | ||
::: | ||
|
||
[docusaurus]: https://docusaurus.io/ | ||
[docusaurus-docs]: https://docusaurus.io/docs | ||
[mdx]: https://mdxjs.com/ | ||
[markdown-features]: https://docusaurus.io/docs/markdown-features |
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 |
---|---|---|
|
@@ -482,5 +482,10 @@ module.exports = { | |
], | ||
}, | ||
"glossary", | ||
{ | ||
type: "category", | ||
label: "Meta", | ||
items: ["meta/docs"], | ||
}, | ||
], | ||
}; |
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,15 +1,31 @@ | ||
const path = require("path"); | ||
|
||
// Make `@components/` resolve to `src/components`. | ||
module.exports = () => { | ||
return { | ||
name: "site-plugin", | ||
|
||
// Make `@components/` resolve to `src/components`. | ||
configureWebpack: (_config, _isServer) => ({ | ||
resolve: { | ||
alias: { | ||
"@components": path.resolve(__dirname, "src/components/"), | ||
}, | ||
}, | ||
}), | ||
|
||
// Append new PostCSS plugins. | ||
configurePostCss: (postcssOptions) => { | ||
postcssOptions.plugins.push( | ||
require("tailwindcss"), | ||
require("postcss-nested"), | ||
require("postcss-preset-env")({ | ||
autoprefixer: { | ||
flexbox: "no-2009", | ||
}, | ||
stage: 4, | ||
}) | ||
); | ||
return postcssOptions; | ||
}, | ||
}; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const colors = require("tailwindcss/colors"); | ||
const plugin = require("tailwindcss/plugin"); | ||
|
||
module.exports = { | ||
mode: "jit", | ||
purge: ["./src/**/*.{js,jsx,ts,tsx}", "./content/**/*.mdx"], | ||
corePlugins: { | ||
preflight: false, | ||
}, | ||
// Using custom dark variant `html[data-theme="dark"]` to match Docusaurus. | ||
darkMode: false, | ||
theme: { | ||
extend: { | ||
colors: { | ||
brand: "#b1361e", | ||
// Admonitions colors | ||
note: colors.coolGray[600], | ||
"note-content": colors.coolGray[500], | ||
tip: colors.emerald[600], | ||
"tip-content": colors.emerald[600], | ||
info: colors.lightBlue[500], | ||
"info-content": colors.lightBlue[700], | ||
warning: colors.orange[500], | ||
"warning-content": colors.orange[700], | ||
caution: colors.red[600], | ||
"caution-content": colors.red[500], | ||
}, | ||
}, | ||
}, | ||
variants: { | ||
extend: { | ||
backgroundColor: ["dark"], | ||
textColor: ["dark"], | ||
display: ["dark"], | ||
}, | ||
}, | ||
plugins: [ | ||
plugin(({ addVariant, e }) => { | ||
addVariant("dark", ({ modifySelectors, separator }) => { | ||
modifySelectors(({ className }) => { | ||
return `html[data-theme="dark"] .${e( | ||
`dark${separator}${className}` | ||
)}`; | ||
}); | ||
}); | ||
}), | ||
], | ||
}; |
Oops, something went wrong.