amiroff / NextBook

NextBook is quick and easy way to build technical books or documentation with markdown that run blazingly fast.
https://next-book.vercel.app
MIT License
228 stars 34 forks source link

Gitbook Theme #332

Open lacymorrow opened 1 year ago

lacymorrow commented 1 year ago

This may not be useful since there isn't a great way to define quick and dirty themes with tailwindcss.

I updated some code, fixed some bugs, and changed many styles to be closer to Gitbook.com, as I am replacing Gitbook with Nextbook. Feel free to use it or discard.

image

Thanks for this project.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-book ❌ Failed (Inspect) Aug 7, 2024 10:00pm
next-book-soik ❌ Failed (Inspect) Aug 7, 2024 10:00pm
amiroff commented 1 year ago

Great work! If you could just tweak contrast for left separator line in dark mode to be more subtle, I am all in for merging this. image

lacymorrow commented 1 year ago

Thanks for looking it over, the only issue I'm seeing is that code blocks will increase the width of the main content section on smaller resolutions. I added code to styles/app.css#56 that works around the issue but it could be better.

lacymorrow commented 1 year ago

This also changes things like:

lacymorrow commented 1 year ago

I've also updated nextjs to v13 and converted to the new style of <Link>, if you want I can pull those changes in as well.

I would like to update the current link (permalink) when the user scrolls, but it needs to be throttled as next doesn't like using router to change hash on scroll

lacymorrow commented 1 year ago

@amiroff bumping this, take a look when you get a chance, this will probably add a few quality-of-life improvements.

I'm also adding authentication (next-auth) and content management (tinaCMS), I could pull those changes into a PR if you like. Also the upgrade to Nextjs 13

amiroff commented 1 year ago

@lacymorrow thanks a lot for your efforts! Look and feel wise It looks awesome!

Looking at the preview here, I just had the opportunity to test Copy Link feature, and it looks like it adds one more # to the link. Is this a bug? Example url being copied: https://next-book-git-fork-aam-institute-gitbook-amiroff.vercel.app/nextbook/nextbook-features##collaboration--deployment

amiroff commented 1 year ago

Upd: a slight bug I see with code blocks not quite fitting the responsive layout: image image

lacymorrow commented 1 year ago

Yeah I still haven't figured out the code blocks yet, the <pre> tags seem to break the layout.

I'll fix both today.

lacymorrow commented 1 year ago

@amiroff fixed the hash in the "Copy Link" component and the code blocks width. Take a look when you can.

amiroff commented 1 year ago

@lacymorrow sorry, has been off the grid for a while. Let's call this version 3.1. Could you please add some notes on what has been added since 3.0 to the readme file? Since we are going to squash and merge, tracking with commits would not be possible. 🙏🏻

amiroff commented 1 year ago

@amiroff fixed the hash in the "Copy Link" component and the code blocks width. Take a look when you can.

For me clicking it does not copy the link unfortunately.

lacymorrow commented 1 year ago

10 months later, fixed the scrollspy and "Copy Link" action.

amiroff commented 1 year ago

Going to check ASAP. Thanks for not giving up.

amiroff commented 11 months ago

@lacymorrow hte build fails on Vercel, did not try locally though. What about you?

[01:58:47.254] Running build in Washington, D.C., USA (East) – iad1 (Hive)
[01:58:47.356] Cloning github.com/amiroff/NextBook (Branch: gitbook, Commit: 794d05e)
[01:58:47.362] Skipping build cache, deployment was triggered without cache.
[01:58:47.763] Cloning completed: 407.332ms
[01:58:48.005] Running "vercel build"
[01:58:48.493] Vercel CLI 32.5.5
[01:58:48.829] Installing dependencies...
[01:58:49.959] npm ERR! code ERESOLVE
[01:58:49.961] npm ERR! ERESOLVE unable to resolve dependency tree
[01:58:49.961] npm ERR! 
[01:58:49.962] npm ERR! While resolving: next-book@2.1.0
[01:58:49.962] npm ERR! Found: @mdx-js/mdx@2.3.0
[01:58:49.962] npm ERR! node_modules/@mdx-js/mdx
[01:58:49.962] npm ERR!   @mdx-js/mdx@"^2.1.5" from the root project
[01:58:49.962] npm ERR! 
[01:58:49.962] npm ERR! Could not resolve dependency:
[01:58:49.962] npm ERR! peer @mdx-js/mdx@"^1.6.16" from mdx-embed@1.1.2
[01:58:49.962] npm ERR! node_modules/mdx-embed
[01:58:49.962] npm ERR!   mdx-embed@"^1.1.2" from the root project
[01:58:49.962] npm ERR! 
[01:58:49.963] npm ERR! Fix the upstream dependency conflict, or retry
[01:58:49.963] npm ERR! this command with --force or --legacy-peer-deps
[01:58:49.963] npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
[01:58:49.964] npm ERR! 
[01:58:49.964] npm ERR! 
[01:58:49.964] npm ERR! For a full report see:
[01:58:49.964] npm ERR! /vercel/.npm/_logs/2023-11-17T22_58_49_145Z-eresolve-report.txt
[01:58:49.965] 
[01:58:49.965] npm ERR! A complete log of this run can be found in: /vercel/.npm/_logs/2023-11-17T22_58_49_145Z-debug-0.log
[01:58:49.977] Error: Command "npm install" exited with 1
[01:58:50.111] 
lacymorrow commented 11 months ago

Ok it's an issue with the way the new version of NPM resolves legacy dependencies from NPM < 7+.

Three options:

I went ahead and forked the repo and updated the dependencies, and pulled them into this PR. You should be able to run npm i as normal now.

Let me know if you'd like me to update this project's dependencies.