0.1.3 • Published 2 years ago

genji-notebook v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Genji Notebook

A doc tool based on Genji to build observable and interactive website. It is inspired by Dumi and Docusaurus.

demo

Get Started

Install genji-notebook from NPM.

$ npm i genji-notebook

Create a new config file named .genjirc in your project root, and specify the outline options.

{
  "outline": {
    "Hello World": "hello-world"
  }
}

Create a folder named docs in your project root and create a markdown file named hello-world.md with the following content.

# Hello World

```js
(() => {
  const div = document.createElement("div");
  div.innerText = "Hello World";
  div.style.background = "red";
  return div;
})();
```

Your project structure is now arranged as below:

.
|____docs
| |____hello-world.md
|____.genjirc

Then run the following command in your project root for development and open http://localhost:8000/#/ in your browser.

$ genji-notebook dev

Everything is working as expected if your see the page as blew.

example

The red div with "Hello World" in the codeblock of the markdown file is already being rendered into the document!

Finally run the following command in your project root before you want to deploy your site.

$ genji-notebook build

Futhermore, if you want to deploy the site using Github Pages, update the .genjirc. (Replace <account> with your github account name and replace <repo> with your repo name).

{
  "outline": {
    "Hello World": "hello-world"
  },
  "siteGithub": "https://github.com/<account>/<repo>",
  "base": "/<repo>/"
}

Then run:

$ genji-notebook deploy

You can visit https://<account>.github.io/<repo>/#/ after deploying success.

Options

The options for .genjirc are as followed.

KeyTypeDescriptionDefault
inputstringThe path to the folder containing all the markdown files.docs
outputstringThe path to produce the site.dist
outlineobjectA nested object to specifies the outline. Every key of the object is the name displayed in the sidebar. It relates a markdown file if the value is the name of the markdown file and it can be a section with object value.-
assetsstringThe path to the assets folder and all the assets used for the site should be in it.assets
logostringThe path to the logo of the site.-
githubstringThe github link for the site.-
linkstringThe custom link for the site.-
notFound.titlestringThe title for missing page.Page Not Found
notFound.descriptionstringThe description for the missing page.We could not find what you were looking for.
scriptsstring[]A path array to the scripts used in the site.[]
theme.mainColorstringThe main color for the site.#28DF99
basestringThe base path for the site.""
siteGithubstringThe link to the repo to host the site.(See gh-pages options.repo)-
siteBranchstringThe name of the branch you'll pushing to. (See gh-pages options.branch)gh-pages
domainstringThe domain of your site. It will create a CNAME file if it is specified.undefined

See more in demo as an example.

License

MIT

0.1.2

2 years ago

0.1.3

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.1.0

2 years ago

0.1.1

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago