encode / django-rest-framework

Web APIs for Django. 🎸
https://www.django-rest-framework.org
Other
27.83k stars 6.76k forks source link

Update docs_theme to boostrap V5.x #9404

Open mostafaei2002 opened 1 month ago

mostafaei2002 commented 1 month ago

I am trying to update the docs_theme to bootstrap v5.x, There were some problems with the previous version. The process shouldn't be very hard since the whole HTML structure is less than 250 lines. I don't know how much custom css, js is written for the current active version though. If everything goes smoothly I should finish in a week or two. Ideally I would love to use something other than mkdocs to generate the static HTML web pages. Bootstrap itself seems fine but mkdocs isn't that good. I like something like Astro much better. Probably better to keep it quick and simple though and not overdo it.

mostafaei2002 commented 1 month ago

Some updates on my progress so far. I setup webpack for the project and the development environment. The navbar structure is almost completely updated. The side nav structure can be a bit improved and I haven't really touched the main content so far. For the next step there is some discussion needed as most of the project will be finished and the only thing to work on will be the styles, To be more precise customizing the bootstrap variables and styles it is. And also setting up the dark mode which should be very easy with the tools bootstrap provides.

mostafaei2002 commented 1 month ago

I would love to have hear your opinions on the new theme. There are some problems specifically with the old django rest framework picture and the sponsers' picture on the dark mode but everything else looks quite good to me. It's fully responsive as far as I've tested it and there is light & dark themes. To build the website use the following commands.

  1. npm install inside /docs_theme
  2. npm run build:watch inside /docs_theme
  3. mkdocs serve inside / directory (don't forget to install mkdocs from requirements.txt beforehand)