xenocrat / chyrp-lite

An ultra-lightweight blogging engine, written in PHP.
https://chyrplite.net/
BSD 3-Clause "New" or "Revised" License
417 stars 44 forks source link

Feature Request - Markdown `enableNewlines`, feed truncation, Questions #156

Closed luxvw closed 1 year ago

luxvw commented 2 years ago

It would be convenient to have an option to enable the enableNewlines feature of the GithubMarkdown parser, and another option to truncate site feed to <!--more--> tag in compliance with read_more module.

OpenSans and Hacker webfonts are hard-coded font-face/font-family of almost all displayable pages, it's hard to change them in admin area. Maybe a linked stylesheet would be more flexible?

Plus a question about twig filters.
As for preg_match and preg_replace, is there any way to get backreferences from capture groups?

xenocrat commented 2 years ago

Hello there,

Thank you for the feature requests.

I’ll consider how I might offer enableNewLines and “read more” for feeds. The latter can and should be offered as an option by adding a settings page for the module. The former I’m not keen to expose in the UI, but I might find a way to offer for those users who really want it.

On fonts, I decided a long time ago that Open Sans and Hack are my fonts of choice for Chyrp Lite, and that’s that. To use other fonts on your blog, the solution is to duplicate and customise one of the themes, so that you have a portable solution that will survive upgrades. For the admin console, you are welcome to hack on the CSS but that’s not supported or encouraged by me. ;-)

The preg_replace filter is just a wrapper for the PHP function so you should be able to use back references in the replacement pattern. However preg_match is a wrapper for the helper function match_any and doesn’t support returning an array of matches.

luxvw commented 2 years ago

Well I tried preg_replace again and the back reference do works, somehow I made a mistake earlier.

Thank you very much for your reply, it really helps.

xenocrat commented 1 year ago

These additions are available in the latest release.