Skip to content

24-Tony/HTML_Python_Syntax_Highlighter

Repository files navigation

HTML Python Syntax Highlighter

html_Syntax

A program to generate Python syntax highlighting in HTML.

This program was intended for use by students at UoPeople, however, anyone can use it.

Latest version (v 2.0.0): View

Previous versions:

Version View Code Release Download
v 2.0.0 View View Download
v 1.1.0 View View None
v 1.0.3 View None None
v 1.0.2 View None None

Using the Highlighter

Note: the program may not work for every code and I probably missed a few highlighting built-ins.

You may encounter the following question:

Prompt

If you do not encounter it you are using an older version and it is defaulting to command line mode

Interface (only for versions 2.0.0 and higher)

On the first run, the program will complete some initialization, this may take a few seconds.

image

It is pretty self-explanitory, but here is an example video of using it: (It may seem shaky embeded in here, to solve this press the three dots (⁝) button and click download. Then open the file and watch it there.)

Syntax.Highlighter.mp4

Command line (themes and specific outputs may be slightly different, but these instructions should give a general idea)

  1. Run the program - open the file and press the [F5] button on your keyboard.

  2. Chose the theme:

Theme Selector Image

  1. The program should display a warning

Warning Image

  1. Next type your command

    • It should resemble: htmlCode('''Paste Code Here'''), htmlCode('Paste Code Here', inline=True), htmlCode('''Paste Code Here''').preview(), htmlCode('Paste Code Here', inline=True).preview(), html_NoColor('''Paste Code Here'''), or html_NoColor('Paste Code Here', inline=True)

      Default

      Which previews as: Default Preview

    • Or if you are using the command HighlightCode()

      HighlightCode

      Which previews as: HighlightCodePreview

  2. Copy the output and paste it into the html editor

    To access the editor:

    • Go to your post

    • Click on the [Advanced] button next to cancel.

      image

    • Then, click on the [↴] button and then [</>] button.

      image

    • The output would then be pasted into the HTML editor.

Themes

Themes

Alternatives

Here are some alternatives to this syntax highlighter: