Code Monkey home page Code Monkey logo

nextbook's Introduction

NextBook Screenshot

Build

NextBook is quick and easy way to buid technical books or documentation that support modern standards and run blazingly fast. It works by compiling markdown and MDX to static pages. This way, first content render on user's device is near instant.

NextBook makes writing technical docs stupid simple while keeping featureset minimal but open for further extension.

Primary Features ๐Ÿงฟ

  • ๐Ÿ’… Good looking, simple and readable UI based on tailwindcss including dark mode and auto-centered layout,
  • ๐ŸŒŽ Great SEO out of the box,
  • ๐Ÿ“ฑ Mobile & printer friendly,
  • ๐Ÿš€ Single page application with pre-fetching,
  • ๐Ÿงพ Easy content creation with markdown and MDX support,
  • ๐Ÿ’ป Something more than what basic fenced code offers. Like line highlighting, linking to source and copying to clipboard,
  • ๐Ÿค“ Familiar Git workflow and collaboration,
  • โŒจ๏ธŽ Keyboard shortcuts for frequently used actions (theme change, page navigation),
  • ๐Ÿ”Ž In-page optional table of contents with scroolspy,
  • ยฉ You own your data, code is the data. Committing to repository and seeing results in the simplest form,
  • ๐ŸŽ Fast to get started, just one command for up & running locally,
  • ๐ŸŽŠ One click (or push) deployment,
  • ๐Ÿ›  Unlimited dynamic features can be added with MDX,
  • โš™๏ธŽ Customisable, extensible and simple codebase,
  • โค Built on open-source,
  • ๐Ÿ‘ And many more small details...

With the advantages of Next.js and React anything fancy (grading, level switching...) can be added along the way.

What's New In NextBook 3.0?

This release contains major speed improvements and backwards incompatible changes. Most of these come from MDX2 removing some functionality and other old libraries still not supporting ES modules.

  • Migrated to next-mdx-remote v.4 which now uses MDX2. This has some speed improvements and stricter MDX syntax checking. See MDX2
  • Replaced some custom incompatible markdown plugins with MDX counterparts. These are:
    • Subscript: was ~, became <sub> tag.
    • Superscript: was ^, became <sup> tag.
    • Mark (higlight): was ==, became <mark> tag.
    • Changed syntax for Accordion and Tabs components. See related documentation.
  • Removed functionality
    • Indented code. This was removed from MDX2. Use other ways to define fenced code blocks.
    • Linking with angle brackets: This was removed from MDX2. Use other ways to define links.

What's New In NextBook 2.0?

  • Support for multiple books in one project.
  • Design based on tailwindcss.
  • Markdown content is now being loaded with next-mdx-remote. This means content is now separated from routed pages.
  • Auto-centered layout on big resolutions leading to one less configuration option.
  • 40% smaller bundle size.
  • Navigation bar.
  • Refined mobile UI.
  • Less code (โˆ’4,000 LOC).

Getting Started

  1. Having Node installed beforehand, bootstrap a new project with npx create-next-app my-awesome-book -e https://github.com/amiroff/NextBook
  2. Run npm run dev:watch and open http://localhost:3000/
  3. Check documentation to see what's possible with NextBook.
  4. Create your markdown or MDX content in content folder. Pages should auto-refresh as you modify markdown content.
  5. Update config/config.json with your table of contents and other information.
  6. Update pages/index.jsx to suit your needs as a standalone landing page or as a redirect to content.
  7. Deploy your respository or export (npm run export) and copy your content to any static hosting provider like Vercel, Netlify, Github Pages or Google Cloud.
  8. Have fun! ๐ŸŽ‰

This should be enough to have a statically generated documentation page/book.

nextbook's People

Contributors

amiroff avatar dependabot[bot] avatar haydendaly avatar laosb avatar matt-goldman avatar metin-emiroglu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nextbook's Issues

npm run export not working

Hello

I ran npm run export but the execution remains stuck on Creating an optimized production build.

Any thoughts?

What's the bare minimum command to run to get static content ?

Hello,

I am a bit confused. I can run npm run dev:watch and get something on http://localhost:3000 but how do I export this to static pages ?

So I could just copy those pages to apache, nginx, S3, etc. ?

npm run build seems to build something but the current folder don't have any new files or directory. npm run export complains about page "/" and says to consult next.js help.

Thanks :).

Q&A: i18n Feature

Hello. Can you help me about i18n, please? Will this project include i18n features into the source code?
Thanks!!!!!!

Widescreen boxing

When having the NextBook page open on a widescreen it currently looks like this:
image
The font gets bigger as well which looks a little wierd in my opinion.

Would it be possible to box this in? (Like GitBook for example)
image

"npm run dev" not working

I installed nextbook and run

error message

Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:

  1. You might have mismatching versions of React and the renderer (such as React DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app
    See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
    at resolveDispatcher (C:\Intellij\projects\nextjs\yoonco-book\node_modules\react\cjs\react.development.js:1476:13)
    at useState (C:\Intellij\projects\nextjs\yoonco-book\node_modules\react\cjs\react.development.js:1507:20)
    at ThemeContextProvider (C:\Intellij\projects\nextjs\yoonco-book.next\server\pages_app.js:1338:61)
    at processChild (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\react-dom\cjs\react-dom-server.node.development.js:3353:14)
    at resolve (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\react-dom\cjs\react-dom-server.node.development.js:3270:5)
    at ReactDOMServerRenderer.render (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\react-dom\cjs\react-dom-server.node.development.js:3753:22)
    at ReactDOMServerRenderer.read (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\react-dom\cjs\react-dom-server.node.development.js:3690:29)
    at renderToString (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\react-dom\cjs\react-dom-server.node.development.js:4298:27)
    at Object.renderPage (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\next\dist\next-server\server\render.js:54:851)
    at Function.getInitialProps (C:\Intellij\projects\nextjs\yoonco-book.next\server\pages_document.js:841:19)
    at loadGetInitialProps (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\next\dist\next-server\lib\utils.js:5:101)
    at renderToHTML (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\next\dist\next-server\server\render.js:54:1142)
    at runMicrotasks ()
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\next\dist\next-server\server\next-server.js:109:97
    at async C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\next\dist\next-server\server\next-server.js:102:142
    warn - C:/IntelliJ/projects/nextjs/yoonco-book/node_modules/@babel/runtime/helpers/arrayLikeToArray.js
    There are multiple modules with names that only differ in casing.
    This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
    Use equal casing. Compare these module identifiers:
  • C:\IntelliJ\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\arrayLikeToArray.js
    Used by 2 module(s), i. e.
    C:\IntelliJ\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\unsupportedIterableToArray.js
  • C:\Intellij\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\arrayLikeToArray.js
    Used by 2 module(s), i. e.
    C:\Intellij\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\arrayWithoutHoles.js

C:/IntelliJ/projects/nextjs/yoonco-book/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:

  • C:\IntelliJ\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\arrayWithoutHoles.js
    Used by 1 module(s), i. e.
    C:\IntelliJ\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\toConsumableArray.js
  • C:\Intellij\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\arrayWithoutHoles.js
    Used by 1 module(s), i. e.
    C:\Intellij\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\toConsumableArray.js

C:/IntelliJ/projects/nextjs/yoonco-book/node_modules/@babel/runtime/helpers/assertThisInitialized.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:

  • C:\IntelliJ\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\assertThisInitialized.js
    Used by 2 module(s), i. e.
    C:\IntelliJ\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\possibleConstructorReturn.js
  • C:\Intellij\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\assertThisInitialized.js
    Used by 1 module(s), i. e.
    C:\Intellij\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\possibleConstructorReturn.js

Using NextBook as a tool or with external pages?

If I were to use NextBook in the current setup, I would fork the repo and start replacing the files in the pages directory. I could then commit my pages to my fork. But as soon as you update NextBook and I do an upstream pull, chances are that there will be merge conflicts. Also having multiple books would not work well as one can only fork a project once, I think. Thus working on multiple books quickly becomes a maintenance nightmare, or they would be stuck with whatever version of NextBook was used when the project was set up.

Is there a way to use NextBook like an external tool? (e.g. like Jekyll, Hugo, ...) So it can be updated on its own, while the content it works on is in a separate repository?

Maybe NextBook can somehow be configured to use a different config and pages-directory? E.g. something like npm run build --work-dir=../my-book/? This would already help a lot.

I really like the output that NextBook produces and the rich feature set, but I don't yet feel confident that it fits in my workflow.

Tags index

This is so cool there is tags support and they are displayed on the website.

image

But it's not really useful unless they are clickable and let access an index of pages using the same tag.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.