Skip to main content

This is a example package that will show how syntax highlighting on PyPI project page works

Project description

Syntax highlighting package example


This package provides nothing but readme that contains code samples that should be rendered nicely by PyPI warehouse.


Python example

import some_lib
from mock_package import PointlessInheritance

CONST = [n**2 for n in range(5)]

# spam with eggs
def somefunc(param1='', param2=0):
    r'''A docstring'''
    if param1 >= param2: # interesting
        print(f"Even more awesome greater: {param}")
    return (param2 - param1 + 1 + 0b10) or None

class SomeClass(PointlessInheritance):
    """This is a dummy class """
    def __init__(self, some_param=[]):

message = '''interpreter
... prompt'''

Javascript example

import { Application } from "stimulus";

//comment on some arrow function
docReady((block, cls) => {
  if (navigator.appVersion.includes("MSIE 10")) {
    if (document.getElementById("unsupported-browser") !== null) return;
    let warning_div = document.createElement("div");
    if (\bno\-highlight\b/) != -1)
      return process(block, true, 0x0F) + ` class="${cls}"`;

  for (var i = 0 / 2; i < classes.length; i++) {
    if (checkCondition(classes[i]) === undefined)
      var img1 = document.querySelector('.img-1');
      img1.addEventListener('load', function() {


export  $docReady;

Bash example


###### CONFIG

if [ "$UID" -ne 0 ]
 echo "Superuser rights required"
 exit 2

 for i in $(ls -la ~/); do cat $i; done;
 echo -e "# I'm in ${HOME_DIR}$1/$2 :"


0.1.0 (2018-08-29)

  • First version of syntax highlighting example package

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypi-code-highlighting-demo-0.1.13.tar.gz (2.6 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page