# @getgood/build-your-own-sinatra

> A book on building Ruby frameworks

Latest version **1.0.4** (published 2019-10-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install @getgood/build-your-own-sinatra
pnpm add @getgood/build-your-own-sinatra
yarn add @getgood/build-your-own-sinatra
bun add @getgood/build-your-own-sinatra
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2019-10-24 |
| First published | 2019-08-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 18 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 (+10 in 1 direct dependencies) |
| Install scripts | no |
| Author | K-2052 |
| Maintainers | k2052 |
| Keywords | article, post |

## Links

- npm: https://www.npmjs.com/package/@getgood/build-your-own-sinatra
- npm.io page: https://npm.io/package/@getgood/build-your-own-sinatra

## Dependencies (18)

- [next](https://npm.io/package/next.md) ^9.0.3
- [react](https://npm.io/package/react.md) ^16.9.0
- [md-styles](https://npm.io/package/md-styles.md) ^1.0.0
- [next-orga](https://npm.io/package/next-orga.md) 0.0.5
- [react-dom](https://npm.io/package/react-dom.md) ^16.9.0
- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [orga-loader](https://npm.io/package/orga-loader.md) 0.0.5
- [react-icons](https://npm.io/package/react-icons.md) ^3.7.0
- [@getgood/lib](https://npm.io/package/@getgood/lib.md) 0.0.4
- [rehype-prism](https://npm.io/package/rehype-prism.md) ^0.1.1
- [remark-emoji](https://npm.io/package/remark-emoji.md) ^2.0.2
- [@mdx-js/loader](https://npm.io/package/@mdx-js/loader.md) ^1.3.1
- [@zeit/next-css](https://npm.io/package/@zeit/next-css.md) ^1.0.1
- [postcss-nested](https://npm.io/package/postcss-nested.md) ^4.1.2
- [react-markdown](https://npm.io/package/react-markdown.md) ^4.1.0
- [rehype-highlight](https://npm.io/package/rehype-highlight.md) ^3.0.0
- [@mapbox/rehype-prism](https://npm.io/package/@mapbox/rehype-prism.md) ^0.3.1
- [next-transpile-modules](https://npm.io/package/next-transpile-modules.md) ^2.3.1

## Recent versions

- 1.0.4 (latest) — 2019-10-24
- 1.0.3 — 2019-08-21
- 1.0.2 — 2019-08-21
- 1.0.1 — 2019-08-20
- 1.0.0 — 2019-08-19

## README

# This is a book

This is the README for using the book, if you want to actually read this book you can click over to [src/README.org](./src/README.org)

## Usage

A book is a npm package so all the typical npm stuff applies, npm publish, npm run build to build etc. The html version is built using next.js so all the next.js stuff applies for building the html.

### Including in a Project

Books are npm packages so they can be easily included in a project. Install the mdx loader into your favorite bundler and then just import like this:

```javascript 
import TOC from "book-name/TOC.mdx"

const App = () => {
  return (
    <TC />
  )
}
```

**TODO**: Add js compilation

You can also import the javascript version by doing:

```javascript 
import Book from "article-name/index.js"

const App = () => {
  return (
    <Book />
  )
}
```

### Assets

Books are flat npm packages and using any assets is as simple as importing them:

```javascript 
import CoverImage from "book-name/assets/cover.png"
```

### Components

Some books use mdx and export components. You can import and use these like any JS module, you will need to make sure to run them through babel as the raw ES6 code is published and no commonjs modules are provided.

### Building

You can build the ebook's site using next:

```sh 
$ npm run build
```

### Building Epub

https://github.com/cyrilis/epub-gen

### Building PDF

Run:

```sh
$ npm run build:pdf
```

### Publishing to NPM

Run the following:

```sh 
$ npm run build && npm publish --access public
```

Or:

```sh 
$ npm run release
``**

### Publishing to Leanpub

**TODO** 

- Implement Leanpub publishing

## License

This book is licensed under ISC. (c) K-2052

---
_Source: https://npm.io/package/@getgood/build-your-own-sinatra · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
