-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use Tidy on html #1164
Comments
You are using python 3, right? Probably it's just that noone tried this and it's not working right. |
Yes, I'm using Python 3.3, but the 2.7 version is also installed. If I have installed nikola using pip, is there a way to change the Python version used ? |
Easiest is just to install it again: pip-2.7 install nikola Or wait 15' and I'm sure I can find you a simple patch ;-) I was lying, probably won't have time to look at it today. |
I’ll attempt a fix soon. |
Signed-off-by: Chris “Kwpolska” Warrick <[email protected]>
With all that brokenness in the tool, it's sort of pointless. |
So, what is the official resolution? (a) nuke tidy-in-Nikola altogether; or |
(c) Tidy-HTML-Light were we strip empty lines and indenting spaces altogether. Force line breaks before and after closing sectioning elements. Better than nothing. |
Google doesn’t seem to know what Tidy-HTML-Light is. Same goes for DuckDuckGo. I’m pretty sure it doesn’t exist. |
Well, if the goal is to produce pretty HTML, we could just use lxml and pretty-print it. |
Two kind of goals here: smaller output (stripped whitespace) or pretty HTML. Tidy-HTML-Light is better known as regex. |
Thanks for the help. I tried using 2.7, but after that, my site refused to build with an UTF-8 error. I will continue 3.3. It was more a test than a real need, so don't worry too much about it for me. Do I let the issue open ? |
@wichtounet you should create a new issue describing the UTF-8 problem. We will close this issue if we believe we fixed it well enough (or that we won’t fix it). |
For stripping whitespace, yui-compress or whatever does a much better job. For prettier HTML, lxml does a much better job. So, let's fix this by removing tidy. |
Signed-off-by: Chris “Kwpolska” Warrick <[email protected]>
Hi,
I enabled the tidy filter on html file:
from nikola import filters
FILTERS = {
".html": [filters.tidy],
}
and now NIkola refuses to build my site:
TaskError - taskid:render_tags:../categories/index.html
PythonAction Error
Traceback (most recent call last):
File "/usr/lib64/python3.3/site-packages/doit/action.py", line 360, in execute
returned_value = self.py_callable(_self.args, *_kwargs)
File "/usr/lib64/python3.3/site-packages/nikola/utils.py", line 529, in unlessLink
action(target)
File "/usr/lib64/python3.3/site-packages/nikola/filters.py", line 144, in tidy
for line in output.split("\n"):
TypeError: Type str doesn't support the buffer AP
Is there a problem with tidy ? Can I use another thing as a replacement ?
The text was updated successfully, but these errors were encountered: