Markdown input field preview option #7412

Closed
opened 2025-12-29 20:23:05 +01:00 by adam · 4 comments
Owner

Originally created by @Omripresent on GitHub (Dec 22, 2022).

Originally assigned to: @aronjohanns on GitHub.

NetBox version

v3.3.9

Feature type

New functionality

Proposed functionality

Similar to Github, a web UI option to preview the formatted result of the comments/journal fields without the need to save the object.

Use case

Currently users are modifying the same object multiple times when trying to format with markdown on device comments or journal entries.
This causes unnecessary database updates and change log records.
A preview option to the comments field would mitigate this.

Database changes

No response

External dependencies

No response

Originally created by @Omripresent on GitHub (Dec 22, 2022). Originally assigned to: @aronjohanns on GitHub. ### NetBox version v3.3.9 ### Feature type New functionality ### Proposed functionality Similar to Github, a web UI option to preview the formatted result of the comments/journal fields without the need to save the object. ### Use case Currently users are modifying the same object multiple times when trying to format with markdown on device comments or journal entries. This causes unnecessary database updates and change log records. A preview option to the comments field would mitigate this. ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: feature labels 2025-12-29 20:23:05 +01:00
adam closed this issue 2025-12-29 20:23:05 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 22, 2022):

This should be pretty easy to accomplish using HTMX, which is already in use in various places within the UI. I'm not sure what would be most appropriate for the backend piece of this; would it make sense to introduce an API endpoint to facilitate the Markdown rendering? (IMO we should avoid trying to duplicate the rendering on the frontend since there are bound to be minor inconsistencies with the backend rendering logic.)

@jeremystretch commented on GitHub (Dec 22, 2022): This should be pretty easy to accomplish using [HTMX](https://htmx.org/), which is already in use in various places within the UI. I'm not sure what would be most appropriate for the backend piece of this; would it make sense to introduce an API endpoint to facilitate the Markdown rendering? (IMO we should avoid trying to duplicate the rendering on the frontend since there are bound to be minor inconsistencies with the backend rendering logic.)
Author
Owner

@aronjohanns commented on GitHub (Mar 1, 2023):

@jeremystretch I think creating an endpoint in api/extras called render-markdown would make sense.

I was having fun taking a look at the frontend department of this. And I created this widget that is replacement for the textarea widget in CommentField. I am quite happy with the look of this.
Screenshot 2023-03-01 at 08 37 12

Then I would use htmx to get rendered preview.

I can own this and implement the functionality of this if we are happy with my proposed implementation (extras endpoint, widget, and the look).

@aronjohanns commented on GitHub (Mar 1, 2023): @jeremystretch I think creating an endpoint in api/extras called render-markdown would make sense. I was having fun taking a look at the frontend department of this. And I created this widget that is replacement for the textarea widget in CommentField. I am quite happy with the look of this. <img width="861" alt="Screenshot 2023-03-01 at 08 37 12" src="https://user-images.githubusercontent.com/71449504/222087539-f363ce51-20a3-42e5-af40-b08747e2eedc.png"> Then I would use htmx to get rendered preview. I can own this and implement the functionality of this if we are happy with my proposed implementation (extras endpoint, widget, and the look).
Author
Owner

@jeremystretch commented on GitHub (Mar 1, 2023):

@aronbj20 great work! Love the look. Want me to assign this FR to you? Happy to collaborate on the HTMX backend as needed.

@jeremystretch commented on GitHub (Mar 1, 2023): @aronbj20 great work! Love the look. Want me to assign this FR to you? Happy to collaborate on the HTMX backend as needed.
Author
Owner

@aronjohanns commented on GitHub (Mar 1, 2023):

@jeremystretch yes that would be great, thank you.

@aronjohanns commented on GitHub (Mar 1, 2023): @jeremystretch yes that would be great, thank you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7412