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.

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

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
File Size Uploaded Provenance Actions
sphinx_hackerrank-2026.11.6.tar.gz 174.2 kB With provenance Details for sphinx_hackerrank-2026.11.6.tar.gz

Built distribution (wheel)

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

Total release size: 186.7 kB

Release files / sphinx_hackerrank-2026.11.6.tar.gz

Download URL sphinx_hackerrank-2026.11.6.tar.gz
Size 174.2 kB
Tags Source
SHA-256 checksum
How to use checksums
75a220b8e33376e019279e1a7626b8805dbdcc663e4a2f2e750facd047cebe3a
BLAKE2b-256 checksum
How to use checksums
81b8c3b9cdf90b51b918d67e17761c940b9abd79f720ea226d6a2e49b3d26af1
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-py3-none-any.whl

Download URL sphinx_hackerrank-2026.11.6-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc14e5a064485d034988ebbe7927d51e582d1a35572dcb76cb23aa88d95972b3
BLAKE2b-256 checksum
How to use checksums
962fe80b121618abab494e4c84425f0a3109eb9c7e1432b48bf6294e540408ed
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

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