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
===================================


Introduction
============

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

Examples
========

==============
Python example
==============

.. code-block:: python

import some_lib
from mock_package import PointlessInheritance

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

# spam with eggs
@requires_authorization
def somefunc(param1='', param2=0):
r'''A docstring'''
if param1 >= param2: # interesting
breakpoint()
print('Gre\'ater')
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=[]):
pass

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


==================
Javascript example
==================
.. code-block:: javascript

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 (cls.search(/\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)
console.log('undefined');
}

});

export $docReady;

============
Bash example
============
.. code-block:: bash

#!/bin/bash

###### CONFIG
SOME_CONSTANT="/path/string/example"
BE_VERBOSE=false

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

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


Changelog
=========

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.10.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file pypi-code-highlighting-demo-0.1.10.tar.gz.

File metadata

  • Download URL: pypi-code-highlighting-demo-0.1.10.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.5.0 requests-toolbelt/0.8.0 tqdm/4.21.0 CPython/3.6.3

File hashes

Hashes for pypi-code-highlighting-demo-0.1.10.tar.gz
Algorithm Hash digest
SHA256 6de44667c61fa003937c821ad65b291077529bbf833ef0f391f17527e19eb1bd
MD5 64101eb23643435b2eabe9ad49556be4
BLAKE2b-256 41ccf4973b367a4baca3e36b0fd7c7754d68d03d1fa9f7f614cb911eb8e860be

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page