GithubHelp home page GithubHelp logo

Comments (4)

hplgit avatar hplgit commented on September 26, 2024

Hi,

I tried the following test document:

TITLE: Sustentação
AUTHOR: Sustentação
DATE: today

We write some unicode: Sustentação.

and compiled it to plain html, Bootstrap html, and reveal.js beige slides html:

doconce format html test3 --encoding=utf-8
doconce format html test3 --encoding=utf-8 --html_style=bootstrap
doconce slides_html test3 reveal --html_slide_theme=beige

The title comes out right in all cases.

The problem is probably that you did not include --encoding=utf-8. It should be an error message telling this (usually it is but not for unicode in the title), but now there is 😃

from doconce.

lourenko avatar lourenko commented on September 26, 2024

Thank you for the fast answer. A make a new test, called test.do.txt:

TITLE: Sustentação
AUTHOR: Marcos Lourenço
DATE: Sexta, 12 de junho de 2015

!split
===== Test unicode Ação =====

!bslidecell 00 0.6
 * Only a simple
 * Test!
!eslidecell

And compile the code with a make.sh:

name=test
doconce format html $name
doconce format html $name --encoding=utf-8
doconce format html $name --encoding=utf-8 --html_style=bootstrap
doconce slides_html $name reveal --html_slide_theme=beige

And still returning an error at the output:

translating doconce text in test.do.txt to html
Traceback (most recent call last):
  File "/usr/local/bin/doconce", line 1177, in <module>
    main()
  File "/usr/local/bin/doconce", line 1167, in main
    eval(command + '()')
  File "<string>", line 1, in <module>
  File "/usr/local/bin/doconce", line 92, in format
    doconce.doconce.format_driver()
  File "/usr/local/lib/python2.7/dist-packages/doconce/doconce.py", line 4499, in format_driver
    out_filename = file2file(filename_preprocessed, format, basename)
  File "/usr/local/lib/python2.7/dist-packages/doconce/doconce.py", line 3478, in file2file
    filestr = doconce2format(filestr, format)
  File "/usr/local/lib/python2.7/dist-packages/doconce/doconce.py", line 3905, in doconce2format
    filestr = INTRO[format] + filestr
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 306: ordinal not in range(128)
translating doconce text in test.do.txt to html
open file with encoding utf-8
output in test.html
translating doconce text in test.do.txt to html
open file with encoding utf-8
output in test.html
slides written to test.html

I'm using kubuntu 15.

from doconce.

lourenko avatar lourenko commented on September 26, 2024

When I remove the first line of make.sh, it compiles properly. In this case, the make.sh is:

name=test
doconce format html $name --encoding=utf-8
doconce format html $name --encoding=utf-8 --html_style=bootstrap
doconce slides_html $name reveal --html_slide_theme=beige

It is all good now. Thanks for the nice package and for the help!

from doconce.

hplgit avatar hplgit commented on September 26, 2024

If you update to the most recent doconce version, you will get a sensible error message about missing encoding in your test case, rather than the UnicodeDecodeError from Python.

from doconce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.