-
Notifications
You must be signed in to change notification settings - Fork 542
Enhancement: Docs upgrade- kit-docs and sveltejs/kit #1665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
1c58fac
initial docs folder replacement
leightkt f4e5212
update links on intro page
leightkt d197771
add export NODE_OPTIONS to build command
leightkt 22160b5
update links on contribution guide
leightkt 15ef4f8
audit and fix remainder of links
leightkt 7675c2f
update svelte config to warn for handleHttpError and handleMissingId
leightkt b24f9fc
rename Introduction file
leightkt 89b029c
cleanup introduction file
leightkt f4bc931
copy over docs readme
leightkt 03cd06f
match font color
leightkt 82b7936
fix merge conficts with dev
leightkt 589e72d
format everything
leightkt d3614be
upate .prettierrc to match previous docs- reformat
leightkt 9c31556
remove redunant line from .gitignore
leightkt 98fc790
add GA tag fix package name, remove comment
leightkt 0a49ff2
add unstoppable resolution to modules
leightkt e142853
add new graphic
leightkt 1a1deba
add apikey to react module
leightkt f47e5c4
add cede.store
leightkt 214b88f
add cede warning
leightkt b6a7151
update network list
leightkt 4b9504b
merge dev
leightkt 53b0ea0
cede updates
leightkt bfae7ba
merge develop
leightkt 6be290e
add secondary tokens
leightkt 2f1273f
add core package note
leightkt 86f2cc9
Merge branch 'develop' into kitdocs-upgrade
leightkt e9cb50a
fix accountCenter double declaration
leightkt 6c2143d
update Tabs component colors
gesquinca d85e9b6
updates
leightkt 1e82869
remove extra tabs component
leightkt 1eda20a
merge develop
leightkt 1aa8084
move cede.store
leightkt 37301eb
update packages add secondary chains to docs connect module and bn icon
leightkt b65c5b3
add frame to docs
leightkt 9bd47cf
merge develop
leightkt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -6,4 +6,4 @@ node_modules | |
| .env | ||
| .env.* | ||
| !.env.example | ||
| .vercel | ||
| vite.config.js.timestamp-* | ||
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,14 +1,14 @@ | ||
| /// <reference types="@sveltejs/kit" /> | ||
| /// <reference types="@svelteness/kit-docs/globals" /> | ||
|
|
||
| // See https://kit.svelte.dev/docs/types#app | ||
| // for information about these interfaces | ||
| // and what to do when importing types | ||
| declare namespace App { | ||
| // interface Locals {} | ||
| // interface Platform {} | ||
| // interface Session {} | ||
| // interface Stuff {} | ||
| declare global { | ||
| namespace App { | ||
| // interface Error {} | ||
| // interface Locals {} | ||
| // interface PageData {} | ||
| // interface Platform {} | ||
| } | ||
| } | ||
|
|
||
| declare module '@svelteness/kit-docs/tailwind.config.cjs' | ||
| export {} |
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,112 @@ | ||
| # `kit-docs` | ||
|
|
||
| ## Global Components | ||
|
|
||
| You can create Svelte components that are global by placing them in this directory. Global | ||
| components are imported into every single Markdown file. In addition, they're automatically | ||
| mapped to Markdown containers, on which you can pass in props and dynamic slot elements. | ||
|
|
||
| First, create a component in this directory: | ||
|
|
||
| ``` | ||
| src | ||
| └─ kit-docs | ||
| ├─ Button.svelte <- | ||
| ``` | ||
|
|
||
| Now, inside your markdown files you can use the `<Button>` component like so: | ||
|
|
||
| ```svelte title=Component.md | ||
| <!-- Use the component as-is. --> | ||
| <Button /> | ||
|
|
||
| <!-- Or, use a markdown container. --> | ||
| :::button propA="valueA"|propB=10 Default slot content here. ::: | ||
|
|
||
| <!-- You can pass in dynamic slot elements! --> | ||
| <!-- If you omit `tag`, it'll default to `<p>`. --> | ||
| :::button (tag=h1&slot=title)=Title Default slot content here. ::: | ||
| ``` | ||
|
|
||
| ### Configuration | ||
|
|
||
| You can configure how global Svelte components are mapped to rules or containers by setting | ||
| them in your plugin like so: | ||
|
|
||
| ```js title=svelte.config.js | ||
| kitDocsPlugin({ | ||
| markdown: { | ||
| components: [ | ||
| // Override inline rule. | ||
| // `Image.svelte` must be a global component. | ||
| { name: 'Image', type: 'inline', rule: 'image' }, | ||
| // Override block rule. | ||
| // `Blockquote.svelte` must be a global component. | ||
| { name: 'Blockquote', type: 'block', rule: 'blockquote' }, | ||
| // Create custom container. | ||
| // `Button.svelte` must be a global component. | ||
| { name: 'Button', type: 'custom', container: { marker: '!' } } | ||
| ] | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
| The configuration above will transform the following Markdown like so: | ||
|
|
||
| ```md | ||
|  | ||
|
|
||
| > This is a blockquote. | ||
|
|
||
| !!!button | ||
| ... | ||
| !!! | ||
| ``` | ||
|
|
||
| ```svelte | ||
| <Image href="https://..." alt="alt text" /> | ||
|
|
||
| <Blockquote>This is a blockquote.</Blockquote> | ||
|
|
||
| <Button>...</Button> | ||
| ``` | ||
|
|
||
| ## Default Components | ||
|
|
||
| There's a few components we provide out of the box such as `CodeFence`, `CodeInline`, `Link` and | ||
| others. You can find all of our [default components](https://github.com/svelteness/kit-docs/tree/main/packages/kit-docs/src/lib/kit-docs) | ||
| on GitHub. | ||
|
|
||
| ### Overriding | ||
|
|
||
| If you want to override any of the default components, simply create a Svelte component with the | ||
| same name in this directory and make sure it accepts the same props. | ||
|
|
||
| For example, you can override `CodeFence` by creating it in this directory like so: | ||
|
|
||
| ``` | ||
| src | ||
| └─ kit-docs | ||
| ├─ CodeFence.svelte <- | ||
| ``` | ||
|
|
||
| Finally, you can use the following minimal boilerplate and style the component as desired: | ||
|
|
||
| ```svelte title=CodeFence.svelte|copy | ||
| <script> | ||
| /** @type {string} */ | ||
| export let lang | ||
| /** @type {string} */ | ||
| export let ext | ||
| /** @type {string} */ | ||
| export let code | ||
| /** @type {number} */ | ||
| export let linesCount | ||
| /** @type {[number, number][]} */ | ||
| export let highlightLines = [] | ||
| </script> | ||
|
|
||
| <div class={`lang-${lang} ext-${ext}`}> | ||
| {@html code} | ||
| </div> | ||
| ``` |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.