Python Forum
Misplaced question: How do you describe this feature? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: Misplaced question: How do you describe this feature? (/thread-29605.html)



Misplaced question: How do you describe this feature? - Drone4four - Sep-11-2020

I'm pretty sure this is the wrong sub-forum to ask, but I don't know where else to ask it. So I'll just ask it. Maybe a moderator can move this thread to the correct sub-forum.

Take a look at this web page for Derek Banas' terrific Django tutorial here. If you scroll down, there is a code block. I'm writing my own rudimentary Django CMS and would like to implement a similar 'block code' or 'code snippet' feature for my blog posts which showcases some basic Python algorithms with syntax highlighting and shows line numbers. My question for all of you is: What do you call that feature? If I had a name for it I am sure I could find basic boilerplate to display code blocks on my web pages.

I Googled: 'code snippets blog' which turned up a few plugins for Wordpress and Blogger but I can't find anything for Django. I Googled 'code snippets django' which turned up the https://djangosnippets.org/ website and GitHub repo, which is not what I want at all.


RE: Misplaced question: How do you describe this feature? - Gribouillis - Sep-12-2020

I think you would have more results by googling "django syntax highlighter"


RE: Misplaced question: How do you describe this feature? - ndc85430 - Sep-12-2020

Or something like "display code in HTML pages". I'd also be inclined to inspect the element in the page to see which elements, CSS classes, etc. it uses to see if there was anything sufficiently unique that I could google.


RE: Misplaced question: How do you describe this feature? - Drone4four - Sep-17-2020

(Sep-12-2020, 07:24 AM)ndc85430 Wrote: Or something like "display code in HTML pages". I'd also be inclined to inspect the element in the page to see which elements, CSS classes, etc. it uses to see if there was anything sufficiently unique that I could google.

That's a great idea! I should have inspected the element on that web page to reveal the name of the syntax highlighter. Turns out, it's called the Crayon Syntax Highlighter. Here is their GitHub page. This is precisely what I needed. Thanks, @ndc85430!