How to force send warnings about rst errors found by docutils to Nikola log on rendering

44 views
Skip to first unread message

MAVignau

unread,
Dec 26, 2017, 7:35:32 PM12/26/17
to nikola-discuss
I found errros on posts in .rst format that cause system-messages issued by docutils on conversion.

This ends in the final html, but there are no warning issued on rendering time.

That forces me to check by hand every post.

I tried to develop a LateTask plugin to filter every system-message, but I don't find documentation that explain the exact format and variants of this unpleasants 'error boxes', so I can't be secure about catching every one.

You can check my plugin on

https://linkode.org/#GHSvhEL8ICKWt4KdtRgBh6


Chris Warrick

unread,
Dec 27, 2017, 5:23:59 AM12/27/17
to Nikola—Discuss
> --
> You received this message because you are subscribed to the Google Groups
> "nikola-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nikola-discus...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Warnings should be displayed when building a post. Run `nikola build
-a` to rebuild everything and show the warnings. You can also try
`grep -R system-message .` or `grep -R error .` to get a list quickly.

--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16

MAVignau

unread,
Dec 28, 2017, 8:22:34 PM12/28/17
to nikola-discuss
Hi!

I tried your suggestion but it doesn't work.

It just passed the malformed post like another one.

It puts something like in post 54

<div class="system-message" id="id1">
<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">&lt;string&gt;</tt>, line 41); <em><a href="posts/0054/#id2">backlink</a></em></p>
Inline emphasis start-string without end-string.</div>

but when I render it on the log there aren't a warning, it pass silently

.  render_sources:output/posts/0054/index.rst

You can see the entire log of creation there: https://linkode.org/#zKemzIXIO4dI3BH0TdmJt4

Note: . check_warnings are the messages send using my plugin, which I trying to debug.

Chris Warrick

unread,
Dec 29, 2017, 7:37:16 AM12/29/17
to Nikola—Discuss
On 29 December 2017 at 02:22, MAVignau <mavi...@gmail.com> wrote:
> Hi!
>
> I tried your suggestion but it doesn't work.
>
> It just passed the malformed post like another one.
>
> It puts something like in post 54
>
> <div class="system-message" id="id1">
>
> <p class="system-message-title">System Message: WARNING/2 (<tt
> class="docutils">&lt;string&gt;</tt>, line 41); <em><a
> href="posts/0054/#id2">backlink</a></em></p>
> Inline emphasis start-string without end-string.</div>
>
>
> but when I render it on the log there aren't a warning, it pass silently
>
> . render_sources:output/posts/0054/index.rst
>
> You can see the entire log of creation there:
> https://linkode.org/#zKemzIXIO4dI3BH0TdmJt4
>
> Note: . check_warnings are the messages send using my plugin, which I trying
> to debug.

So, logbook changed their log level numbers, and the feature broke.
This is how it looks when it works:

. render_posts:cache/posts/1.html
[2017-12-29T12:29:35Z] WARNING: compile_rest: [posts/1.rst:15] Inline
emphasis start-string without end-string.

I fixed it in master and v7.8.11 (a new maintenance release).

MAVignau

unread,
Dec 30, 2017, 8:56:32 PM12/30/17
to nikola-discuss
Thanks.

I just put

pip install --upgrade nikola

and it works!

Very good job.
Reply all
Reply to author
Forward
0 new messages