sissbruecker / linkding

Self-hosted bookmark manager that is designed be to be minimal, fast, and easy to set up using Docker.
MIT License
5.36k stars 263 forks source link

Add "notes_html" field to API #627

Open perrotuerto opened 5 months ago

perrotuerto commented 5 months ago

I wonder if it is possible to add a "notes_html" field to the api that reuses the shared render of bookmark.notes as its value. It would help to keep the same HTML structure across different services/uses.

sissbruecker commented 4 months ago

Eh, maybe? Should be an optional thing though, maybe to be enabled with a query param.

perrotuerto commented 4 months ago

Thanks for the reply, @sissbruecker, may be something like:

GET /api/bookmarks/<id>/html/

I will like to help you with this!

sissbruecker commented 4 months ago

Hmm, adding a separate endpoint seems a bit convoluted. If more options like these are added then you would end up with a large number of routes, plus combinations of those. I was thinking more about a query param to control this: GET /api/bookmarks/<id>/?notes_html. Also wondering if this should work for the list endpoint as well.

Apart from that the markdown rendering logic should be extracted into a class maybe, so that it can be used in both the template tag and in the API serializer.

perrotuerto commented 3 months ago

With the list? Do you mean the tags?

GET /api/bookmarks/<id>/?notes_html that retrieves the HTML format of the notes by a new class for the markdown formatter sounds good to me. I will start to work with the development setup.