~dmbaturin/soupault

5 2

Output of `pandoc --standalone` is treated as partial page

Details
Message ID
<45125540-4375-463e-9144-4dd52b78769d@gmail.com>
DKIM signature
pass
Download raw message
Hi all,

I'm really excited about Soupault!

My posts are written in Markdown with YAML metadata, so I reached for 
pandoc to preprocess them, as the manual proposes.

I'm using the `--standalone` option, so the output of pandoc contains an 
`html` block. According to the documentation (and my `config.toml`), I 
would assume that Soupault would put the output of pandoc as a complete 
page, but in fact it's still inserted in the `main.html` template.

Has anyone encountered this before?

I would appreciate any help you can give me. Let me know if I can 
provide any more details for troubleshooting.

Thanks for your attention!

Auguste
Details
Message ID
<a7049eb1-0cb4-495e-a042-9db73859d81b@baturin.org>
In-Reply-To
<45125540-4375-463e-9144-4dd52b78769d@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Hi Auguste,

You have found a bug.
I inadvertently broke the whole complete page functionality when I added 
a fix for https://github.com/PataphysicalSociety/soupault/issues/58

The cause is that the default HTML parsing function can introduce 
unfortunate corrections so I added a fixup
to force parsing of pages that may be templated in the "body fragment" 
mode, without realizing that that mode
will delete <html> element if it's present to force the result to a 
valid body fragment.

I've just pushed a fix: 
https://codeberg.org/PataphysicalSociety/soupault/commit/3ca0981bca91df132ead049f8f7c3be32d56a63a
You can find more details about the issue in the comments there.

The solution, for now, involves parsing HTML twice, but from my quick 
test, it adds only about 100ms
to the build time of the soupault.app website.
I still hope to find a clean solution later.

Do you have a build setup to build soupault from source?
If not, let me know what OS you use and I can make a test build for you 
to test.

On 4/17/24 19:16, Auguste Baum wrote:
> Hi all,
>
> I'm really excited about Soupault!
>
> My posts are written in Markdown with YAML metadata, so I reached for 
> pandoc to preprocess them, as the manual proposes.
>
> I'm using the `--standalone` option, so the output of pandoc contains 
> an `html` block. According to the documentation (and my 
> `config.toml`), I would assume that Soupault would put the output of 
> pandoc as a complete page, but in fact it's still inserted in the 
> `main.html` template.
>
> Has anyone encountered this before?
>
> I would appreciate any help you can give me. Let me know if I can 
> provide any more details for troubleshooting.
>
> Thanks for your attention!
>
> Auguste
>
Details
Message ID
<65c14ac0-fd98-49ca-9135-38ce89f38328@gmail.com>
In-Reply-To
<a7049eb1-0cb4-495e-a042-9db73859d81b@baturin.org> (view parent)
DKIM signature
pass
Download raw message
Wow, thanks for the quick response! I can build soupault on my own; I'll 
try the patched version as soon as possible.

Thanks again :)
Details
Message ID
<dd702fa9-4b9c-40d4-a5eb-5f2448ae072f@gmail.com>
In-Reply-To
<a7049eb1-0cb4-495e-a042-9db73859d81b@baturin.org> (view parent)
DKIM signature
pass
Download raw message
As it turns out, I can't get it to build on my machine (NixOS). I get 
this error:

```

File "src/soupault.ml", line 225, characters 22-51:
225 |   let _interim_html = Html_utils.parse_html_default 
~encoding:settings.page_character_encoding page_source in
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound value Html_utils.parse_html_default

```

The build did succeed for the commit right before, though.
Details
Message ID
<9aa46d04-cc20-4259-a346-96d2538454b1@baturin.org>
In-Reply-To
<dd702fa9-4b9c-40d4-a5eb-5f2448ae072f@gmail.com> (view parent)
DKIM signature
missing
Download raw message
I'm sorry — I was quite tired and forgot to `git add` a file, so I had 
to amend and force-push a fix.

Please pull from the repo and try again, and let me know if there are 
any issues.

Also, FIY: I have a tiny feature in mind and a fix that is already 
complete in OTOML,
then I can make a release since I have no other plans and the bug you've 
found is serious enough
to warrant a release ASAP.

On 4/17/24 23:25, Auguste Baum wrote:
> As it turns out, I can't get it to build on my machine (NixOS). I get 
> this error:
>
> ```
>
> File "src/soupault.ml", line 225, characters 22-51:
> 225 |   let _interim_html = Html_utils.parse_html_default 
> ~encoding:settings.page_character_encoding page_source in
>                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Error: Unbound value Html_utils.parse_html_default
>
> ```
>
> The build did succeed for the commit right before, though.
>
Details
Message ID
<99ba6b16-0211-49ad-b9b7-d27c0213481b@gmail.com>
In-Reply-To
<a7049eb1-0cb4-495e-a042-9db73859d81b@baturin.org> (view parent)
DKIM signature
pass
Download raw message
No apologies necessary at all!

It built and seems to have resolved the issue indeed. I'll be on the 
lookout for the next release to distribute it for Nix users.

Thanks again and good night!

Auguste
Reply to thread Export thread (mbox)