hyde / hyde-old

Static website generator inspired by Jekyll
http://ringce.com/hyde
MIT License
877 stars 82 forks source link

issue with hyde tags <!-- Hyde::...::Begin--> and restructured text (and possibly textile and asciidoc) #14

Open solsticedhiver opened 14 years ago

solsticedhiver commented 14 years ago

restructuredtext does not recognise html statement and treat them like text. you have to include them in a raw paragraph like that:

.. raw:: html
   

so that there are outputted like html.

so this cause problem when you use _restructuredtex_t and you have {% article %} or {%excerpt %} tag in the middle of a {% restructuredtext %} block because all the html comment HYDE tag are rendered in html. For example:

{% block article %}
{% restructuredtext %}
{% article %}
{% excerpt %}
This is a test
{% endexcerpt %}
This should show how article and excerpt (django) tags normally rendered in html comment are shown in plain html while inside restructuredtext block
{% endarticle %}
{% endrestructuredtext %}
{% endblock article %}

is rendered in html as :

<p>&lt;!-- Hyde::Article::Begin&nbsp;--&gt;</p> 
<p>&lt;!-- Hyde::Excerpt::Begin&nbsp;--&gt;</p> 
<p>This is a test
&lt;!-- Hyde::Excerpt::End --&gt;
This should show how article and excerpt (django) tags normally rendered in html   comment are shown in plain html while inside restructuredtext block
&lt;!-- Hyde::Article::End&nbsp;--&gt;</p> 

one have to use {% restruturedtext %} block at lowest level possible and use article and excerpt blocks on the outer level of restructured text block.

i guess that the same problem could be find with textitle and asciidoc if they can't recognize html statement and do treat them like text.

JoshRosen commented 14 years ago

About a year ago I ran into a related issue with reStructuredText and excerpt template tags, although I didn't get around to fixing it:

http://groups.google.com/group/hyde-dev/browse_thread/thread/2dfecfe3fab29896

navilan commented 14 years ago

Custom markers for excerpt and article should fix this. Will add support for it.

solsticedhiver commented 14 years ago

i have noted too, that hyde eats my title at the beginning of resctructuredtext section for example

----
Test
----
Another title
=============
This is a test

is rendered as

This is a test

By looking at the code, i found that, may be, using html_body instead of fragment in line 87 of ./hydeengine/templatetags/aym.py would be better. it allows to have the full html from the rest snippet.

another issue i have is that any snippet like above gives me h1 header. and i can't get h2 header only without having h1 header. that's a problem with rest and not hyde of course.

solsticedhiver commented 14 years ago

a (hackish ? ) solution to the problem of excerpt hyde tag is to use restructured text comment in your rst text. This is my fisrt post

.. Hyde::Excerpt::Begin

This will be the excerpt of the article

.. Hyde::Excerpt::End

Here is the rest of the post

there will be transformed into html comment that hyde will find as if they were transfromed from django tag.

for article you can do the same but {%article %} {% endarticle %} are better placed at the outside of the article ?

pascalw commented 13 years ago

Unfortunately I'm still experiencing this issue in version 0.4, with textile in my case. Any way to decently solve this? Placing the textile tags inside every posting works, but is terribly hackish.

navilan commented 13 years ago

I have responded to a similar issue - but idea is to move away from markers and use context. In most cases the new reference tag should be very useful.