Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/likianta/code-snippet-book

Craft your fancy works with the loved code snippets.
https://github.com/likianta/code-snippet-book

code-copy-paste code-gist code-snippet copy-code gists nextra python

Last synced: about 9 hours ago
JSON representation

Craft your fancy works with the loved code snippets.

Awesome Lists containing this project

README

        

# Likianta Code Snippet Book

## Motivation

this is mainly for showing something via **[Nextra](https://nextra.site/)** site generator. visit the deployed site effect [here](https://likianta.github.io/code-snippet-book).

## Installation

the main stack is nodejs (nextjs), while the plugin scripts are written in python.

we need to both init them:

nodejs:

```sh
# install by `project.json`
npm install
```

python (poetry):

```sh
# install by pyproject.toml
poetry update
```

## Development

```sh
npm run dev
```

## Deploy

```sh
# build but not deploy (useful for checking if build worked)
npm run build

# build and deploy
npm run deploy
```

notice: make sure there exists `./out/.nojekyll` file (an empty file). otherwise the github pages will be failed finding javascript and stylesheets.

## Test deployment in local

```
|=
|= docs
|- index.html
|- ...
|=
|= code-snippet-book # symlinked from `/docs`
|- index.html
|- ...
```

```sh
npm run build
poetry run python3 -m http.server 3001 -d
```

visit http://localhost:3001/code-snippet-book to see effect.