NextBook icon indicating copy to clipboard operation
NextBook copied to clipboard

Gitbook Theme

Open lacymorrow opened this issue 3 years ago • 16 comments

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.

lacymorrow avatar Nov 28 '22 23:11 lacymorrow

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

vercel[bot] avatar Nov 28 '22 23:11 vercel[bot]

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

amiroff avatar Nov 30 '22 09:11 amiroff

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 avatar Nov 30 '22 22:11 lacymorrow

This also changes things like:

  • Adds ability for a chapter heading to have a path property to act as a link (dropdown caret will always act on the dropdown, however)
  • Only highlights a single page in navbar (previously would highlight any page that matched partial paths)
  • Adds a max-width to <pre> tags generated, this may affect the clipboard icon, not sure.

lacymorrow avatar Nov 30 '22 22:11 lacymorrow

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 avatar Nov 30 '22 23:11 lacymorrow

@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

lacymorrow avatar Dec 09 '22 00:12 lacymorrow

@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 avatar Dec 12 '22 14:12 amiroff

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

amiroff avatar Dec 12 '22 14:12 amiroff

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 avatar Dec 12 '22 18:12 lacymorrow

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

lacymorrow avatar Dec 12 '22 21:12 lacymorrow

@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 avatar Jan 03 '23 07:01 amiroff

@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.

amiroff avatar Jan 03 '23 07:01 amiroff

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

lacymorrow avatar Sep 24 '23 02:09 lacymorrow

Going to check ASAP. Thanks for not giving up.

amiroff avatar Sep 25 '23 14:09 amiroff

@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: [email protected]
[01:58:49.962] npm ERR! Found: @mdx-js/[email protected]
[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 [email protected]
[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] 

amiroff avatar Nov 17 '23 22:11 amiroff

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

Three options:

  • Use yarn, the stable default yarn version doesn't have this issue.
  • Use npm i --force or npm i --legacy-peer-deps to resolve legacy deps
  • Use a forked version of mdx-embed.

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.

lacymorrow avatar Nov 19 '23 05:11 lacymorrow