Skip to content

Commit

Permalink
docs: improve wikilinks info
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-8 committed Jun 27, 2023
1 parent 34502ac commit 403a2be
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
8 changes: 4 additions & 4 deletions packages/kitbook/src/docs/2-write-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ By default Kitbook will display your project's README.md file as its home page,

## Naming Conventions

Name files and folders according to how you want them shown in the sidebar. Alphabetically `Get Started` comes after `Button` but you use an initial digit followed by a hyphen to update the sort order, flipped in this example:
- `1-get-started.md` will be displayed as `Get Started`
- `2-button.svelte` which will be displayed as `Button`
Name files and folders according to how you want them shown in the sidebar. Alphabetically `Get Started` comes after `Button` but you can use an initial number followed by a hyphen to update the sort order as seen here:
- `1-get-started.md`, displayed first as `Get Started`
- `2-button.svelte`, displayed second as `Button`

Folder naming follows the same conventions. `0-components/` will show up as `Components` and be place before `1-about/` (displayed as `About`).
Folder naming follows the same conventions. `0-components/` will show up as `Components` and be placed before `1-about/` (displayed as `About`).

## Convenient links

Expand Down
11 changes: 6 additions & 5 deletions packages/kitbook/src/docs/6-easy-wikilinks.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Easy Wikilinks

Kitbook supports using [Foam](https://foambubble.github.io/foam/) to easily add [wikilinks](https://foambubble.github.io/foam/user/features/wikilinks) between your various documentation pages in a manner that ensures they always stay up-to-date. *As an added bonus they also work in Github.*
Kitbook supports using [Foam](https://foambubble.github.io/foam/) to easily add [wikilinks](https://foambubble.github.io/foam/user/features/wikilinks) between your various documentation pages in a manner that ensures they always stay up-to-date. *These links will also work in Github.*

## Setup Foam

- Add the [Foam extension](https://marketplace.visualstudio.com/items?itemName=foam.foam-vscode)
- Add these needed Foam extension settings:
- Add these settings:

```json title=".vscode/settings.json"
{
Expand All @@ -18,7 +18,7 @@ Kitbook supports using [Foam](https://foambubble.github.io/foam/) to easily add
}
```

- Add a placeholder file to tell Foam to turn on:
- Add a placeholder `.vscode/foam.json` file to tell the Foam extension to activate in your repo:

```json title=".vscode/foam.json"
{
Expand All @@ -31,7 +31,7 @@ Kitbook supports using [Foam](https://foambubble.github.io/foam/) to easily add

## Usage

You should read the [Foam](https://foambubble.github.io/foam/) docs, but to give you a quick start, you can create a link to any other `.md` file in your repo by typing `[[` and then letting Foam's autocomplete help you as you type either the filename or the main heading. To link to a page with a name of `5-easy-wiki-links` and a main heading of `Easy Wiki Links`, just start typing heading `[[Easy Wi` and select the autocomplete option to place`[[5-easy-wiki-links]]` in your code. Now you can now click the link in your editor to jump to that file. But it may not be appearing as a link in your browser. Try making one more edit to your file (like a space) and you'll notice Foam automatically creates a [wikilink](https://foambubble.github.io/foam/user/features/wikilinks) reference at the bottom of your file. Kitbook will turn this into the appropriate link for you.
You should read the [Foam](https://foambubble.github.io/foam/) docs, but to get you started, you can create a link to any `.md` file in your repo by typing `[[` and then letting Foam's autocomplete help you as you type either the filename or the main heading. For example, to link to this page which has a name of `6-easy-wikilinks` and a main heading of `Easy Wikilinks`, just start typing heading `[[Easy Wi` and select the autocomplete option to place`[[6-easy-wikilinks]]` in your code which will render like this: [[6-easy-wikilinks]]. Now you can now click the link in your editor to jump to that file. *Note that sometimes Foam is one keystroke behind, and you may need to make one more edit to your file (like a space) and before Foam automatically creates a [wikilink](https://foambubble.github.io/foam/user/features/wikilinks) reference at the bottom of your file. Foam handles the linking in your editor and Kitbook uses these wikilink references to give you appropriate links in the browser.*

The Foam extension does a good job of automatically updating links as you change filenames but until you are very familiar with its behavior, it's a good idea to occasionally run [`Foam: Run Janitor`](https://foambubble.github.io/foam/user/tools/workspace-janitor) from VS Code's command palette to ensure the links across your entire repo are up to date.

Expand All @@ -40,9 +40,10 @@ Sometimes when you link to a page in mid sentence like [[1-get-started|this proj

### Linking to a sub-heading

[Foam](https://foambubble.github.io/foam/) supports [linking to specific sections](https://foambubble.github.io/foam/user/features/wikilinks#support-for-sections) of a page, which you can also take advantage of in Kitbook. So `[[6-easy-wikilinks#Setup Foam]]` would result in a direct link to the section above and looks like: [[6-easy-wikilinks#Setup Foam]] (try it). If you change your section titles, Foam will not automatically update the link to that section though it will give you a linting error on the wikilink that no section with such title exists.
[Foam](https://foambubble.github.io/foam/) supports [linking to specific sections](https://foambubble.github.io/foam/user/features/wikilinks#support-for-sections) of a page, which you can also take advantage of in Kitbook. So `[[6-easy-wikilinks#Setup Foam]]` would result in a direct link to the section above and looks like: [[6-easy-wikilinks#Setup Foam]]. If you change your section titles, Foam will not automatically update the link to that section though it will give you an editor warning on the wikilink that no section with such title exists.

[//begin]: # "Autogenerated link references for markdown compatibility"
[6-easy-wikilinks]: 6-easy-wikilinks.md "Easy Wikilinks"
[1-get-started|this project's amazing guide to getting started]: 1-get-started.md "Get Started: How to Create a KitBook"
[6-easy-wikilinks#Setup Foam]: 6-easy-wikilinks.md "Easy Wikilinks"
[//end]: # "Autogenerated link references"
9 changes: 2 additions & 7 deletions packages/kitbook/src/docs/9-maintainer-notes/4-roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Important before considering this a publicly usable project
*(you have been warned, early-adopters)*

- solve build error: cleanup page files and loads now that routes are not copied into projects
- cleanup page files and loads now that routes are not copied into projects
- automatically analyze component for props
- test in other projects using `kitbook: file:../../../kitbook/packages/kitbook/package`

Expand All @@ -12,8 +12,7 @@
- Add full-screen focus view for sandbox
- make instrument panel show in focus view on mobile

- show Story and Variant code in instrument panel using code editor: `data.loadedModules.svxRaw`
- <!-- i-tabler-code"-->
- show Story and Variant code in instrument panel using code editor: `data.loadedModules.svxRaw` <!-- i-tabler-code"-->

- be able to pass filter option to layout load so that certain pages which will break without proper initialization won't be shown in Kitbook - after this we can start automatically displaying components without stories
- `import { svelte2tsx } from 'svelte2tsx';` `import FolderRaw from './Folder.svelte?raw';`
Expand Down Expand Up @@ -91,7 +90,3 @@
- [svelte-knobby](https://github.com/Rich-Harris/svelte-knobby)
- svelte-headlessui
- https://github.com/importantimport/urara


## dynamic slots scratch notes

0 comments on commit 403a2be

Please sign in to comment.