EmilStenstrom / django-components

Create simple reusable template components in Django.
MIT License
953 stars 59 forks source link

Fix misleading example component docs #426

Closed franciscobmacedo closed 1 month ago

franciscobmacedo commented 1 month ago

The problem

The calendar example component in the README.md has some misleading configuration.

Wrong js and css filenames and filepaths

The example component ilustrates the creation of calendar.js and calendar.css files. However, in the Media class it points to different files: script.js and style.css - both the names and their paths are wrong. There are some other comments in the code snippets that also point to those files.

Wrong filepath in the template_name variable

The template_name variable points to calendar.html when it should be calendar/calendar.html.

The solution

I suggest we follow what the command startcomponent does:

franciscobmacedo commented 1 month ago

I understand that there is already a PR to use mkdocs for the documentation - if you think it's more appropriate, this can just be fixed in that PR.

I'm also happy to make a PR to just update the current README.md in the main branch.

What do you think @EmilStenstrom ?

EmilStenstrom commented 1 month ago

Thanks you @franciscobmacedo, it seems you are right. The mkdocs branch is very early still, with lots of work to do, so I suggest we make a separate PR right away. Mind writing one up?