Skip to content
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

Metadata present as comments in XML feeds #508

Closed
kayhayen opened this issue Jun 3, 2013 · 15 comments
Closed

Metadata present as comments in XML feeds #508

kayhayen opened this issue Jun 3, 2013 · 15 comments

Comments

@kayhayen
Copy link
Contributor

kayhayen commented Jun 3, 2013

-<title>Nuitka Home (Android)</title>http://nu
+<title>Nuitka Home (Android)</title>http://nu
+<!-- slug: letting-go-of-c11 -->
+<!-- date: 2012/10/27 08:59:07 -->
+<!-- tags: Nuitka,compiler,Python,Windows,Android -->
+<!-- link: -->
+<!-- description: How Nuitka came to use C++11 and then stop it. -->
+<p>This post is about Nuitka the Python compiler started out using C++0x

I totally don't want these comments. I suggest to remove them from HTML as well (I assume they are there, but I don't see them due to htmlcompressor)

@ralsina
Copy link
Member

ralsina commented Jun 18, 2013

I am not seeing this right now.

@kayhayen
Copy link
Contributor Author

Indeed, it went away.

@kayhayen kayhayen reopened this Jun 18, 2013
@kayhayen
Copy link
Contributor Author

Actually, I did reproduce it with current master just now. I had manually reset the files in output, and only after erasing output fully, the issue showed.

I now suspect, that the metadata from comments in REST is to blame and that changing the posts to metadata in separate files, will resolve it. In my mind, comments in ReST should not lead to comments in resulting HTML at all, and should be directly removed after compilation.

@ralsina
Copy link
Member

ralsina commented Jun 18, 2013

I agree that those comments at the beginning of the post (which I am not seeing yet) should not be there.

However, in general, comments in rest are compiled into HTML comments by docutils, so not generating those is out of Nikola's scope. We can remove them using some filtering, but I am reluctant to make that the default behaviour for all comments.

As a historical footnote: the reason why the metadata is in rest comments is so that the post files remain valid input for rst2html.

@kayhayen
Copy link
Contributor Author

I believe, the rest compiler should not see the ".. tags:" style comments at the start of the file at all. They are separated by a blank line, and in my mind, not really part of the file.

Remaing valid input is all nice, I agree. But it's also useless input, isn't it. I am surprised you cannot reproduce it though. Did you notice, that you have the check the XML files? All of them have it for me.

@ralsina
Copy link
Member

ralsina commented Jun 18, 2013

Yes. Here's what I do:

nikola init --demo /tmp/test
cd /tmp/test
nikola build

The rss.xml I get is as follows, no comments at al:

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Demo Site</title><link>http://nikola.ralsina.com.ar</link><description>This is a demo site for Nikola.</description><lastBuildDate>Tue, 18 Jun 2013 07:22:50 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Welcome to Nikola</title><link>http://nikola.ralsina.com.ar/posts/welcome-to-nikola.html</link><description>&lt;div class="figure"&gt;
&lt;a class="reference external image-reference" href="http://farm1.staticflickr.com/138/352972944_4f9d568680_z.jpg?zz=1"&gt;&lt;img alt="Nikola Tesla Corner by nicwest, on Flickr" class="thumbnail" src="http://farm1.staticflickr.com/138/352972944_4f9d568680.jpg"&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;If you can see this in a web browser, it means you have managed to install Nikola,
and build a site using it. Congratulations!&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;You can read the manual &lt;a class="reference external" href="/stories/handbook.html"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;You can learn more about Nikola at &lt;a class="reference external" href="http://nikola.ralsina.com.ar"&gt;http://nikola.ralsina.com.ar&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;You can see a demo photo gallery &lt;a class="reference external" href="/galleries/demo/index.html"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Demo usage of listings &lt;a class="reference external" href="/stories/listings-demo.html"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Demo of slideshows &lt;a class="reference external" href="/stories/slides-demo.html"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Send feedback to &lt;a class="reference external" href="mailto:ralsina@netmanagers.com.ar"&gt;ralsina@netmanagers.com.ar&lt;/a&gt;!&lt;/p&gt;</description><category>nikola</category><category>python</category><category>demo</category><category>blog</category><guid>http://nikola.ralsina.com.ar/posts/welcome-to-nikola.html</guid><pubDate>Fri, 30 Mar 2012 23:00:00 GMT</pubDate></item></channel></rss>

@kayhayen
Copy link
Contributor Author

Ah yes, there is no metadata in "posts/1.txt" but in "posts/1.meta".

The problem will only show if you merge the two files.

@ralsina
Copy link
Member

ralsina commented Jun 18, 2013

Oh, silly me. Ok, will look into it.

@ralsina
Copy link
Member

ralsina commented Jun 19, 2013

The fix was a bit bigger than expected, and it's not done for some compilers (HTML/PHP) because it was too much trouble and probably not worth it, but it should be good enough for your case :-)

@kayhayen
Copy link
Contributor Author

I think you forgot some debug prints inside, which make things look ugly.

And it did not help at all, please re-open.

@kayhayen
Copy link
Contributor Author

Ah, seems you fixed that up already.

@ralsina
Copy link
Member

ralsina commented Jun 19, 2013

Yeah, but I broke a bunch of integration tests somehow. So, handle with care for a couple of hours ;-)

@kayhayen
Copy link
Contributor Author

Hm, it's not working, I still have that diff:

-<p>So fork away, like it, and stuff. Awaiting your pull requests...</p
+<p>So fork away, like it, and stuff. Awaiting your pull requests...</p
+<!-- title: Going to Europython 2013 -->

I looked at the commit, kind of looked sensible to me. Made sure I rebased
properly and stuff. Puzzled.

@kayhayen
Copy link
Contributor Author

Oh great, had to delete cache and/or doit.db and then it worked.That's not fun, and really hard to detect.

@ralsina
Copy link
Member

ralsina commented Jun 19, 2013

Right, that's because of the cache, the comments were already there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants