
import locale

from docutils.core import publish_cmdline, default_description
from docutils.parsers.rst import directives
from docutils.parsers.rst import roles

from rst2pdf.directives import code_block
from rst2pdf.directives import noop
from rst2pdf.roles import counter_off


locale.setlocale(locale.LC_ALL, '')

directives.register_directive('code-block', code_block.code_block_directive)
directives.register_directive('oddeven', noop.noop_directive)
roles.register_canonical_role('counter', counter_off.counter_fn)

description = (
    'Generates (X)HTML documents from standalone reStructuredText '
    'sources.  ' + default_description
)

publish_cmdline(writer_name='html', description=description)


import locale

from docutils.core import default_description
from docutils.core import publish_cmdline
from docutils.parsers.rst import directives
from docutils.parsers.rst import roles

from rst2pdf.directives import code_block
from rst2pdf.directives import noop
from rst2pdf.roles import counter_off


locale.setlocale(locale.LC_ALL, '')

directives.register_directive('code-block', code_block.code_block_directive)
directives.register_directive('oddeven', noop.noop_directive)
roles.register_canonical_role('counter', counter_off.counter_fn)

description = (
    'Generates HTML5 documents from standalone reStructuredText '
    'sources.\n' + default_description
)

publish_cmdline(writer_name='html5', description=description)

Switch rst2html to HTML5 builder
Switch rst2html to HTML5 builder

This gives a prettier output and every browser in widespread usage has
supported it for years. The license, which was previously missing, is
added.

Signed-off-by: Stephen Finucane <06fa905d7f2aaced6dc72e9511c71a2a51e8aead@that.guru>

  
  import locale
  
- from docutils.core import publish_cmdline, default_description
+ from docutils.core import default_description
+ from docutils.core import publish_cmdline
  from docutils.parsers.rst import directives
  from docutils.parsers.rst import roles
  
  from rst2pdf.directives import code_block
  from rst2pdf.directives import noop
  from rst2pdf.roles import counter_off
  
  
  locale.setlocale(locale.LC_ALL, '')
  
  directives.register_directive('code-block', code_block.code_block_directive)
  directives.register_directive('oddeven', noop.noop_directive)
  roles.register_canonical_role('counter', counter_off.counter_fn)
  
  description = (
-     'Generates (X)HTML documents from standalone reStructuredText '
+     'Generates HTML5 documents from standalone reStructuredText '
-     'sources.  ' + default_description
+     'sources.\n' + default_description
  )
  
- publish_cmdline(writer_name='html', description=description)
+ publish_cmdline(writer_name='html5', description=description)
  
Switch rst2html to HTML5 builder
## Code Before:

import locale

from docutils.core import publish_cmdline, default_description
from docutils.parsers.rst import directives
from docutils.parsers.rst import roles

from rst2pdf.directives import code_block
from rst2pdf.directives import noop
from rst2pdf.roles import counter_off


locale.setlocale(locale.LC_ALL, '')

directives.register_directive('code-block', code_block.code_block_directive)
directives.register_directive('oddeven', noop.noop_directive)
roles.register_canonical_role('counter', counter_off.counter_fn)

description = (
    'Generates (X)HTML documents from standalone reStructuredText '
    'sources.  ' + default_description
)

publish_cmdline(writer_name='html', description=description)

## Instruction:
Switch rst2html to HTML5 builder
## Code After:

import locale

from docutils.core import default_description
from docutils.core import publish_cmdline
from docutils.parsers.rst import directives
from docutils.parsers.rst import roles

from rst2pdf.directives import code_block
from rst2pdf.directives import noop
from rst2pdf.roles import counter_off


locale.setlocale(locale.LC_ALL, '')

directives.register_directive('code-block', code_block.code_block_directive)
directives.register_directive('oddeven', noop.noop_directive)
roles.register_canonical_role('counter', counter_off.counter_fn)

description = (
    'Generates HTML5 documents from standalone reStructuredText '
    'sources.\n' + default_description
)

publish_cmdline(writer_name='html5', description=description)
