Skip to main content

Build Status PyPI

sphinx-hackerrank

Export Sphinx documentation as self-contained HTML for HackerRank Interviewer Guidelines, with styles and images. Build and preview locally without HackerRank credentials.

Quick start

In an existing Sphinx project:

pip install sphinx-hackerrank

Add "sphinx_hackerrank" to extensions in docs/conf.py. Create docs/review.rst and add review to your existing toctree:

Widget review
=============

.. hackerrank-export:: interviewer-guidelines/review.html
   :name: Widget review

   Interviewer instructions go here.

   .. code-block:: text

      example input

Build:

sphinx-build -W -b hackerrank docs build/hackerrank

Open build/hackerrank/interviewer-guidelines/index.html to preview the exports. Upload build/hackerrank/interviewer-guidelines/review.html using your own publishing tool.

Code blocks are exported as <pre><code> with their original text and whitespace. HackerRank’s project IDE adds native copy controls to these blocks in its Guidelines tab. Hover over a code block to reveal its Copy button. Check copying inside a project interview. The standalone preview displays the exported HTML without the IDE’s controls.

Choosing content

Wrap content in hackerrank-export and give it an HTML output path relative to the build directory. The required :name: option supplies the preview index label. Each boundary is a Sphinx node carrying its destination and name. No CSS selector or export list is needed. Multiple boundaries in the same document export independently. Destinations must be unique and must not overwrite documentation pages or the preview index. The builder also produces ordinary themed documentation pages with the same content and bundled styles.

Python extensions can construct the same boundary directly:

"""Declare an export around prepared Docutils content."""

from docutils import nodes

from sphinx_hackerrank import GuidelineExportNode

content = GuidelineExportNode(
    output_path="interviewer-guidelines/review.html",
    name="Widget review",
)
content += nodes.paragraph("", "Interviewer instructions go here.")
assert content.astext() == "Interviewer instructions go here."

The HTML translator captures the boundary while rendering the full document, preserving Sphinx’s resolved references and image paths. Export metadata is retained across incremental and parallel builds. Other builders receive ordinary containers, preserving their native rendering without additional node handlers.

For collapsible sections, enable sphinx-toolbox.collapse. To reuse guide sections, enable sphinx-section-include. See the sample project for both.

Migrating from selector exports

Replace each GuidelineExport configuration entry with a hackerrank-export directive or GuidelineExportNode around the content being exported. Move output_path and name to that boundary, then remove hackerrank_exports and the old GuidelineExport import. A separate docname and selector are no longer needed. CSS classes remain presentation details.

Contributing

See CONTRIBUTING.rst for checks and releases. MIT licensed.

Metadata

Release files for sphinx-hackerrank 2026.11.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-hackerrank 2026.11.6.1
File Size Uploaded Provenance Actions
sphinx_hackerrank-2026.11.6.1.tar.gz 174.8 kB With provenance Details for sphinx_hackerrank-2026.11.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-hackerrank 2026.11.6.1
File Interpreter ABI Platform Actions
sphinx_hackerrank-2026.11.6.1-py3-none-any.whl Python 3 none any Details for sphinx_hackerrank-2026.11.6.1-py3-none-any.whl

Total release size: 187.6 kB

Release files / sphinx_hackerrank-2026.11.6.1.tar.gz

Download URL sphinx_hackerrank-2026.11.6.1.tar.gz
Size 174.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6eda6e22ca07ae990422b5922fe53a668fad3ec1ea50062fe1b7a4907788a466
BLAKE2b-256 checksum
How to use checksums
511289075c3c704090dbc15fdf4c1fd2a87e6763687f083588db063a0c3f9a58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / sphinx_hackerrank-2026.11.6.1-py3-none-any.whl

Download URL sphinx_hackerrank-2026.11.6.1-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4233d498c099a1e8f684721a276e620439a2bbad7b0b1f88ea489108e9b6dd02
BLAKE2b-256 checksum
How to use checksums
1bf7f1663b9a2b6c9501549f58bdf26c90ed629616ace1acb68ba0e074d36ec1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for sphinx-hackerrank 2026.11.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sphinx_hackerrank-2026.11.6.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page