Bug 797425

Summary: Strange color of [swift-hash]
Product: [Fedora] Fedora Reporter: Pete Zaitcev <zaitcev>
Component: python-sphinxAssignee: Michel Alexandre Salim <michel>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: a.badger, michel, ziga.seilnacht
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-27 03:14:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Pete Zaitcev 2012-02-25 19:02:52 UTC
Description of problem:

A document in openstack-swift has strange coloring in "[swift-hash]".

Version-Release number of selected component (if applicable):

python-sphinx-1.0.7-2.fc15

How reproducible:

Synchronous

Steps to Reproduce:
1. unpack the openstack-swift RPM (rpm -i && rpmbuild -bp), or
   git pull git://github.com/openstack/swift.git
2. cd $topdir
3. python setup.py build_sphinx
4. firefox  file://$topdir/doc/build/html/development_saio.html
  
Actual results:

[swift-hash] is colored strangely

Expected results:

[swift-hash] is not colored or colored uniformly

Additional info:

Apparently other implementations or reST (not Sphinx) process this
document without extra coloring.

Comment 1 Ziga Seilnacht 2012-02-27 01:37:58 UTC
Try setting `highlight_language = console` in `conf.py`. Sphinx by default first tries to parse all code blocks as python, where `hash` is a built in function.

Comment 2 Ziga Seilnacht 2012-02-27 01:52:22 UTC
Or maybe more appropriately for your example, you can use:

#. Create `/etc/swift/swift.conf`:

.. code-block:: ini

        [swift-hash]
        # random unique string that can never change (DO NOT LOSE)
        swift_hash_path_suffix = changeme


See http://sphinx.pocoo.org/markup/code.html for more details.

Comment 3 Pete Zaitcev 2012-02-27 03:14:15 UTC
Indeed, sorry for the noise, and thanks for the example. I'm closing this.