It is a reasonable solution to use the embedded editor of Joomla! to highlight any code on an article. With simply one click on Joomla's TinyMCE Editor, it allows you to insert any highlighted code from any programing languages into a Joomla! Article.

Here goes some sample Python codes,

 

Code 1

print("hello world!")

 

Code 2

import love from me

love1 = love.joomla()
for i in range(5):
    print("No. " + str(i) + str(love1))

 

Code 3

# This is a comment
i = 100
while True:
    i -= 1
    print(i)
    if i < 50:
        break

# This is the end of the code

In order to speed up the loading speed of other pages where the highlight code is not needed, I only enable it on some specific pages, like this page. Here, we can embed the code on this article to enable our highlight code.

What's more, Only Enable Python to reduce the javascript size and save some loading time.

How to speed up your web pages? Read this: How to minimize the loading time of your web pages?

 


Share with friends on:

Follow Jake on:

 

Related articles