Skip to main content

code-block-hl directive, just like code-block but with partial line highlights

Project description

Sphinx Code Highlighter Directive

A Sphinx directive that works just like a code-block plus allows you to highlight partial lines.

Examples

Using MyST markdown:

```{code-block-hl} python
:linenos:
:caption: "The text surrounded by `!!!` gets highlighted."
dwarves = [
  "Bashful",
  "Dopey",
  "Happy",
  "Grumpy",
  "Sleepy",
  "Sneezy",
  "Doc",
]

i = 0
while i < len(!!!dwarves!!!):
  !!!name!!! = dwarves[i]
  print(f"{name}s Room")
  i += 1
```

screenshot

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

sphinx-code-highlighter-0.0.4.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_code_highlighter-0.0.4-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file sphinx-code-highlighter-0.0.4.tar.gz.

File metadata

  • Download URL: sphinx-code-highlighter-0.0.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.9.1 Darwin/22.3.0

File hashes

Hashes for sphinx-code-highlighter-0.0.4.tar.gz
Algorithm Hash digest
SHA256 962ff19b669db45b0aef49e40caa01bf1f6f6850bf6029b3074db6b9c5d80aa7
MD5 578f308555d3306319d2d5c7b67d6695
BLAKE2b-256 2700eb550f4b7a29efe5d308fbe5b4f3b2f5c2c415c6c8954af95792a5d09a5b

See more details on using hashes here.

File details

Details for the file sphinx_code_highlighter-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_code_highlighter-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 00fb2976eb4097fe0547d667be326fdce82630ee2c042babdbe3cb38a81775f8
MD5 f4913c1fc6ba16d3cf58fb4d61820a36
BLAKE2b-256 a00a61e52a9c12792986ae3812178cfbab92fcb34d4137d4a7604b1cbd077149

See more details on using hashes here.

Supported by

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