Skip to content

Commit

Permalink
Fixed docs, thanks for the hint @lelit
Browse files Browse the repository at this point in the history
  • Loading branch information
heuer committed Nov 26, 2021
1 parent 27c6259 commit beed155
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
9 changes: 3 additions & 6 deletions docs/artistic-qrcodes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ The "to_artistic" method can create animated or static QR codes.
>>> import segno
>>> qrcode = segno.make('The Beatles -- Albums', error='h')
>>> qrcode.to_artistic(background='src/albums.gif', target='albums.gif',
... scale=8)
>>> qrcode.to_artistic(background='src/albums.gif', target='albums.gif', scale=8)
.. image:: _static/artistic/albums.gif
:alt: 3-H QR code encoding "The Beatles -- Albums" (animated)
Expand All @@ -78,8 +77,7 @@ The plugin also supports static backgrounds
>>> import segno
>>> qrcode = segno.make('The Beatles -- Let It Be', error='h')
>>> qrcode.to_artistic(background='src/letitbe.jpg', target='letitbe.jpg',
... scale=5)
>>> qrcode.to_artistic(background='src/letitbe.jpg', target='letitbe.jpg', scale=5)
.. image:: _static/artistic/letitbe.jpg
:alt: 3-H QR code encoding "The Beatles -- Let It Be" with a background image
Expand All @@ -94,8 +92,7 @@ the ``kind`` parameter is provided:
>>> import segno
>>> qrcode = segno.make('The Beatles -- Let It Be', error='h')
>>> out = io.BytesIO()
>>> qrcode.to_artistic(background='src/letitbe.jpg', target=out scale=5,
... kind='jpg')
>>> qrcode.to_artistic(background='src/letitbe.jpg', target=out scale=5, kind='jpg')
.. image:: _static/artistic/letitbe.jpg
:alt: 3-H QR code encoding "The Beatles -- Let It Be" with a background image
Expand Down
4 changes: 2 additions & 2 deletions docs/colorful-qrcodes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ more than two colors, every module type may have its own color.
>>> import segno
>>> qrcode = segno.make('Yellow Submarine', version=7, error='h')
>>> qr.save('qrcode_yellow-submarine.png', scale=4, dark='darkred',
... data_dark='darkorange', data_light='yellow')
>>> qrcode.save('qrcode_yellow-submarine.png', scale=4, dark='darkred',
... data_dark='darkorange', data_light='yellow')
.. image:: _static/colorful/qrcode_yellow-submarine.png
:alt: Colorful 7-H QR code encoding "Yellow Submarine"
Expand Down
20 changes: 10 additions & 10 deletions docs/svg-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ the XML declaration, the SVG namespace and a trailing newline.
.. code-block:: python
>>> import segno
>>> qr = segno.make('Penny Lane', error='h')
>>> qr.save('penny-lane.svg', scale=4)
>>> qrcode = segno.make('Penny Lane', error='h')
>>> qrcode.save('penny-lane.svg', scale=4)
.. image:: _static/svg/penny-lane.svg
Expand All @@ -142,8 +142,8 @@ To suppress the XML declaration, use ``xmldecl=False``.
.. code-block:: python
>>> import segno
>>> qr = segno.make('Penny Lane', error='h')
>>> qr.save('penny-lane.svg', scale=4, xmldecl=False)
>>> qrcode = segno.make('Penny Lane', error='h')
>>> qrcode.save('penny-lane.svg', scale=4, xmldecl=False)
XML markup:
Expand All @@ -159,8 +159,8 @@ declaration is superfluous, omit it via ``svgns=False``.
.. code-block:: python
>>> import segno
>>> qr = segno.make('Penny Lane', error='h')
>>> qr.save('penny-lane.svg', scale=4, xmldecl=False, svgns=False)
>>> qrcode = segno.make('Penny Lane', error='h')
>>> qrcode.save('penny-lane.svg', scale=4, xmldecl=False, svgns=False)
XML markup:

Expand Down Expand Up @@ -189,8 +189,8 @@ Since the graphic should take all available space, the ``scale`` may be omitted,
.. code-block:: python
>>> import segno
>>> qr = segno.make('Penny Lane', error='h')
>>> qr.save('penny-lane.svg', xmldecl=False, svgns=False, svgclass=None, lineclass=None, omitsize=True)
>>> qrcode = segno.make('Penny Lane', error='h')
>>> qrcode.save('penny-lane.svg', xmldecl=False, svgns=False, svgclass=None, lineclass=None, omitsize=True)
XML markup.
Expand All @@ -204,8 +204,8 @@ Too squeeze the file size futher, omit the trailing newline character via ``nl=F
.. code-block:: python
>>> import segno
>>> qr = segno.make('Penny Lane', error='h')
>>> qr.save('penny-lane.svg', xmldecl=False, svgns=False, svgclass=None, lineclass=None, omitsize=True, nl=False)
>>> qrcode = segno.make('Penny Lane', error='h')
>>> qrcode.save('penny-lane.svg', xmldecl=False, svgns=False, svgclass=None, lineclass=None, omitsize=True, nl=False)
The result is almost he same, but you've saved a few (abt. 130) bytes
Expand Down

0 comments on commit beed155

Please sign in to comment.