Deprecate markdownify?

I don’t know what all of these updates are about, but the gist of it is that:

  • markdownify is a alias for site.Home.RenderString
  • It’s widely used and very convenient. so we’re not deprecating it.

https://github.com/gohugoio/hugo/issues/9692

I’ve spent a lot of time tracking down variants of this.

Are you saying that my previous post is … wrong?

I’m saying that using .Page.RenderString on the current Page object (not aliased to the home page) eliminates the problems encountered in #9692, and it gives users the options of rendering a single line of markdown as a paragraph.

What do you mean by the “current Page object”?

The thing is, we can discuss this at length (and so we have), you cannot pick a one right Page object for every setting where markdownify is used (unless you want to make it incredibly complicated), so you have to nominate one, and that is now the home page. I would suspect it would be an even bigger gotcha if we e.g. nominated the entry Page.

If this is a real problem, we could certainly move away from using markdownify and tell people to use e.g. page.RenderString, but currently markdownify is meant for Markdown rendering where the page context doesn’t matter, e.g. hello **world**.

The problem with the global page function is understanding what “current page” means, which is why we have warnings in the documentation for this function.

We can agree to disagree, but my guidance to users is to always use .Page.RenderString to avoid nuanced problems that are difficult to notice and track down.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.