1

I have written a software component that relies on a configuration file. For clarity, I want to document the structure of the configuration file by adding an example file in the docstring of the relevant class. For obvious reasons, it should appear in fixed-width font.

The only way I know is adding >>> before each line, which is bad because doctest might think this is a Python code segment and lose its wits. Moreover, it looks really ugly:

>>> [db]

>>> port = 5432

>>> name = adam_db

...

What I really want is:

[db]

port=5432

name=adam_db

...

In a fixed-width font.

Any ideas?

Thanks,

Adam

Community
  • 1
  • 1
Adam Matan
  • 128,757
  • 147
  • 397
  • 562

1 Answers1

2

Maybe you could use the Literal Block option.

user266940
  • 148
  • 7