Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7669439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:35:46+00:00 2026-05-31T15:35:46+00:00

I am using Sphinx to generate HTML documentation for a Python program. I would

  • 0

I am using Sphinx to generate HTML documentation for a Python program.

I would like to use the generic admonition directive with a specific title and have it marked up in a way I can define, for example like content generated with the note directive, i.e., boxed, but with a different color (most Admonitions are not specially styled).

How do I best go about this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:35:47+00:00Added an answer on May 31, 2026 at 3:35 pm

    If I understood your question correctly, you’d like to apply a custon CSS style to the admonition. You can do this with a :class: attibute.

    For example, the following

    .. admonition:: my title goes here
       :class: myOwnStyle
    
       this is the admonition text
    

    renders as

    <div class="myownstyle admonition">
      <p class="first admonition-title">my title goes here</p>
      <p class="last">this is the admonition text</p>
    </div>
    

    You then add your own style sheet. For example, by a custom layout.html in the _templates directory in your source directory:

    {% extends "!layout.html" %}
    {% set css_files = css_files + ["_static/customstyle.css"] %}
    

    Then you can play around with CSS styles in your style sheet using a selector for the myownstyle class

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As the title says I am using Sphinx to generate documentation for a python
I'm using Sphinx and the autodoc extension to generate API documentation for my Python
I'm using Hudson to generate the documentation for a Python project using Sphinx. This
Created using Sphinx 0.6.5. I know Python's documentation uses reStructuredText , but it has
I'm using Sphinx to create the documentation of my project. I want to use
I have a written a program in Python 3 and are using Sphinx to
I am using Sphinx to generate the documentation for a project of mine. In
Is there a way to automatically generate an image/figure caption using sphinx? I currently
I'm using Thinking Sphinx for full-text search, following this video . I'd like to
Using PyObjC , you can use Python to write Cocoa applications for OS X.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.