Coder Social home page Coder Social logo

Comments (6)

warner avatar warner commented on June 24, 2024

I don't know how to fix this yet, but I did find the problem: for .rst files, the <!-- PELICAN_END_SUMMARY --> marker gets HTML-escaped before the summary scanner runs, so it gets &lt;!-- PELICAN_END_SUMMARY --&gt; and doesn't recognize the end marker.

To fix this, either the scanner needs to run before HTML escaping happens, or the scanner should HTML-escape the markers that it's looking for.

from pelican-plugins.

oliverguenther avatar oliverguenther commented on June 24, 2024

While I cannot provide a fix for the escaping in the summary plugin itself, using a raw role provides a workaround. While the use of raw is discouraged in rst (because it forces the output format), it shouldn't be a problem within pelican, as the target platform is html anyway.

.. raw:: html

    <!-- PELICAN_END_SUMMARY -->

from pelican-plugins.

warner avatar warner commented on June 24, 2024

what I ended up doing was to use settings.py to change the markers into something that doesn't get escaped:

SUMMARY_BEGIN_MARKER = "!BEGIN-SUMMARY!"
SUMMARY_END_MARKER = "!END-SUMMARY!"

Works for me: the plugin strips the markers, so they don't actually need to be comments.

from pelican-plugins.

edelooff avatar edelooff commented on June 24, 2024

This is a documentation lack if anything. For reST, the proper way to mark a comment is to have to periods at the start of the line (..). When placing the summary markers like that, everything works fine:

..  PELICAN_BEGIN_SUMMARY

Some content.

..  PELICAN_END_SUMMARY

This part of the post is not included in the summary.

from pelican-plugins.

warner avatar warner commented on June 24, 2024

/me nods. Although I suspect that would force you to use whole paragraphs as the summary (instead of allowing the use of just a few sentences, which sometimes flows better).

from pelican-plugins.

edelooff avatar edelooff commented on June 24, 2024

Yeah, that is a limitation. The alternative is changing the marker of
course. I find paragraphs work well enough but YMMV.
On Jun 9, 2014 10:26 PM, "Brian Warner" [email protected] wrote:

/me nods. Although I suspect that would force you to use whole paragraphs
as the summary (instead of allowing the use of just a few sentences, which
sometimes flows better).


Reply to this email directly or view it on GitHub
#151 (comment)
.

from pelican-plugins.

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.