1
votes

I am creating documentation through Sphinx and restructured text, then issuing the following commands:

$ make html

$ make htmlhelp.

Once that is complete I use HTML Help Workshop to compile a chm file.

The plain HTML documentation looks good, text looks how I want it to.
However when I open the chm file all double quotes are converted to boxes:

enter image description here

Here's a portion of my restructured text:

Opening the FTP in Windows File Explorer
""""""""""""""""""""""""""""""""""""""""

To open the FTP in Windows File Explorer (this may need to be done through a network administrator using group policies):

- Open IE
- Go to the *Tools* menu and select *Internet Options*
- Go to the *Advanced* tab
- Check the box "*Enable ftp folder view (Outside of Internet Explorer)*"

Adding a FTP shortcut to Windows File Explorer
""""""""""""""""""""""""""""""""""""""""""""""

You may want to add a shortcut to it either on your desktop or straight under *My Computer* in Windows File Explorer. The File Explorer shortcut is useful as it only requires you to log in when you first access it during your windows session. To do so:

- Open Windows Explorer
- Right-click on "My Computer" in the navigation panel on the left
- Choose "Add new network location"
- Use the wizard to create a new network location for your FTP site
- The FTP site will now show up in My Computer as a network location. You can make shortcuts from there by right-clicking on the connection and choosing "send to" > "desktop (as shortcut)".

Entering @quot; displays literally as @quot;

How can I fix the restructured text so that both the html and htmlhelp formats display the double quotes?

1
What goes into HTML Help Workshop? The original .rst, .html, or whatever format is generated by makehtmlhelp? If not .rst, then my bet is that Sphinx converts straight quotes in .rst to "smart quotes" in the output, which in turn is not understood by HTML Help Workshop. If so, and depending on your Sphinx version, you will need to set either html_use_smartypants or smart_quotes to False. See sphinx-doc.org/en/stable/… - Steve Piercy
It's important to note that MS HTML Help 1.x (.chm help files) does not support Unicode. See also web link: Unicode Support in HH. I'll have a deeper look into this from home in the evening. - help-info.de
Steve, make htmlhelp creates all html, hhc and hhp files etc. Then you open the htmlhelp project in the workshop and just press compile. Html_use_smartypants is false - Hank
help-info.de, sounds like you're on to something. I'm finished up for the day, however I believe the initial rst documents are utf8. I'll do some more research as well - Hank
I can not reproduce the behavior on a German PC with Windows 10 having Sphinx Version 1.6.5 installed see screenshot with copied text from above. The *.rst source file is encoded in UTF-8 and the resulting *.hhp file has a Language=0x409. I don't have a really good idea. Do you copy your source files from a Linux machine to Windows because of $? - help-info.de

1 Answers

1
votes

The solution: I have Sphinx using a theme called RTD (ReadTheDocs), if you find the theme source code, open the layout.html in any plain text editor.

Found mine here: C:\Python27\Lib\site-packages\sphinx_rtd_theme\layout.html

Find:

  <meta charset="utf-8">

Place conditional logic around it, will omit the utf-8 setting upon building html help:

  {% if 'htmlhelp' not in builder %}
  <meta charset="utf-8">
  {% endif %}

make the htmlhelp, compile the htmlhelp and display, quotes are now displaying correctly: enter image description here