Mike Rockett Posted March 22, 2018 Author Share Posted March 22, 2018 I'd like to get some general feedback from people using the module. If you have a minute, please share your experiences or issues (even those that are self-resolved, if any). If it's looking stable enough, I'd like to bump to stable v1. If there are issues, please also feel free to let me know. Thanks! Link to comment Share on other sites More sharing options...
Macrura Posted March 22, 2018 Share Posted March 22, 2018 Haven't used it directly in a while, but it is live and running on at least 3 sites and haven't had any troubles with those. 1 Link to comment Share on other sites More sharing options...
Mike Rockett Posted March 23, 2018 Author Share Posted March 23, 2018 Thanks Macrura I actually see that I'm going to need to bump PHP Typography to 6.x first, which means I'll land up bumping the module version to 0.5 for a little testing. Looks like there's been a cleanup and some new features added, as well as a bunch of hyphenation languages. Will open an issue for that shortly. Link to comment Share on other sites More sharing options...
mel47 Posted June 9, 2018 Share Posted June 9, 2018 Hi, I currently updating my website, and run with problem with Typographer. I use version 0.4.0 on local 7.0.30-0ubuntu0.16.04.1 Strangely I have this problem only in my home page (other pages seems to work), so I guess it's a specific setting but no idea which one. Can you see it? Thanks! Mel Link to comment Share on other sites More sharing options...
Mike Rockett Posted June 11, 2018 Author Share Posted June 11, 2018 Hi @mel47 Seems odd as the vendor directory is included, and autoloaded. I'll need to take a look at this, but I'm afraid I'll only have time to do so this coming weekend. I'll open up an issue on Git in the meantime. Which version of PW are you running? Link to comment Share on other sites More sharing options...
mel47 Posted June 14, 2018 Share Posted June 14, 2018 Hi @Mike Rockett Sorry, I forgot to mention. I updated last week to the last dev version 3.105. It should be related to either PW version or PHP version, since on my production website, with the same settings and same data, it works fine. I was able to delimited to a specific part : Spoiler $abstracts = $pages->find("template=publication, categ_publi=1108, limit=4, sort=-year, sort=-date_sort"); // abstract foreach($abstracts as $c) { $congres[$c->congress] = $c; } <h4 class='title is-4'> <span class='icon is-medium'><i class='fa fa-globe fa-fw' aria-hidden='true'></i></span> {$abstracts->first()->categ_publi->title}s</h4> <div class='columns'>"; foreach($congres as $c) { $content .= "<div class='column'><div class='box'> <div class='title is-6'><a href='{$c->url}'>{$c->congress}</a></div> <div class='columns is-multiline is-inline-mobile is-centered'> <div class='column'> <span class='icon'><i class='fa fa-calendar fa-fw' aria-hidden='true'></i></span> <p class='is-inline-mobile'>{$c->congress_date} {$c->year}</p> </div> <div class='column'> <span class='icon'><i class='fa fa-map-marker fa-fw' aria-hidden='true'></i></span> <p class='is-inline-mobile'>{$c->congress_location}</p> </div> </div></div></div>"; } I received error for the "congress field". I tried to change the data or even empty, but it didn't change the error. Even deleting "<div class='title is-6'><a href='{$c->url}'>{$c->congress}</a></div>" doesn't help. Everywhere else in the website where it uses this field, I get the same error. Thanks! EDIT: I refine more the issue by comparing my different fields, problematic or not. This field have some <sup></sup> (I export data from a other software, and it's difficult to remove them). Could it be the problem? It wasn't in previous version of PW. Link to comment Share on other sites More sharing options...
Mike Rockett Posted September 24, 2018 Author Share Posted September 24, 2018 Module moved to GitLab: https://gitlab.com/rockettpw/tools/typographer Link to comment Share on other sites More sharing options...
Mike Rockett Posted September 24, 2018 Author Share Posted September 24, 2018 @mel47 – Sorry for the delayed response here. I noticed this is happening on one of my own sites. Will investigate. Link to comment Share on other sites More sharing options...
Mike Rockett Posted September 24, 2018 Author Share Posted September 24, 2018 @mel47 – Hmm, I migrated the site to my newer dev environment, and the issue’s no longer showing up. That said, the Typography package appears to have been updated considerably, so I think it might be an idea to do an upgrade there... Link to comment Share on other sites More sharing options...
d'Hinnisdaël Posted October 24, 2020 Share Posted October 24, 2020 Hi @Mike Rockett, first of all thanks for this wonderful module! Been using this for a while but never stopped by to say thanks. I just sent two pull requests your way I'd love to get your take on. The first one makes the module work well with multi-language sites by adding a hook for modifying the Typographer Settings instance. The second one just updates the underlying php-typography package, while we're at it. 1 Link to comment Share on other sites More sharing options...
Spiria Posted April 17, 2021 Share Posted April 17, 2021 I have a strange problem which is also present with another fork of php-typography. All the letters are spaced... I had hope that your module would have not the same problem. It seems related to the locale. Putting set_space_collapse to false resolves the issue. https://github.com/mundschenk-at/php-typography/issues/137 Link to comment Share on other sites More sharing options...
Spiria Posted April 17, 2021 Share Posted April 17, 2021 I have however another stranger and more important problem in French. Every "ne" which is the negation in French, is replaced by "né"!!! Link to comment Share on other sites More sharing options...
Mike Rockett Posted April 22, 2021 Author Share Posted April 22, 2021 (edited) On 10/24/2020 at 2:28 PM, d'Hinnisdaël said: Hi @Mike Rockett, first of all thanks for this wonderful module! Been using this for a while but never stopped by to say thanks. I just sent two pull requests your way I'd love to get your take on. The first one makes the module work well with multi-language sites by adding a hook for modifying the Typographer Settings instance. The second one just updates the underlying php-typography package, while we're at it. Hi Phillip – I'm so incredibly sorry for neglecting this. I noted in the merge requests that I'd get to it, and then never did. I'm going to go ahead and accept both and release, however I have no reliable way to test without configuring dev-environments for it. So if there are any issues, we can deal with them on an as-and-when-needed basis. Edit: Managed to test. On 4/17/2021 at 11:02 PM, Spiria said: I have a strange problem which is also present with another fork of php-typography. All the letters are spaced... I had hope that your module would have not the same problem. It seems related to the locale. Putting set_space_collapse to false resolves the issue. https://github.com/mundschenk-at/php-typography/issues/137 On 4/17/2021 at 11:27 PM, Spiria said: I have however another stranger and more important problem in French. Every "ne" which is the negation in French, is replaced by "né"!!! Very strange. Seems like something that would need to be fixed in the underlying package. Updating to v6.6 now as part of the above merge request at least. ? Edited April 22, 2021 by Mike Rockett 2 Link to comment Share on other sites More sharing options...
Spiria Posted April 22, 2021 Share Posted April 22, 2021 29 minutes ago, Mike Rockett said: Very strange. Seems like something that would need to be fixed in the underlying package. Updating to v6.6 now as part of the above merge request at least. ? In fact, switching the diacritic corrections to off in French resolved the problem. "ne" is set to be corrected into "né" when you are in English. Link to comment Share on other sites More sharing options...
Mike Rockett Posted April 22, 2021 Author Share Posted April 22, 2021 Hmm, I'm trying to release v1 but the module system won't allow me to. I'm signed in, and the module is listed, but clicking on edit takes me back to my module list... Can somebody help me out with this? Link to comment Share on other sites More sharing options...
Mike Rockett Posted April 22, 2021 Author Share Posted April 22, 2021 Ok that seems to have been due to caching - the module system heavily caches frontend pages, which it shouldn't really be doing for pages that require authentication... Anyways, I have a new problem now. It seems that PW no longer accepts projects that live outside GitHub (it used to, as the current module points to the GitLab repo). @ryan – would it be possible to allow non-GitHub repositories? 1 Link to comment Share on other sites More sharing options...
Mike Rockett Posted April 22, 2021 Author Share Posted April 22, 2021 I figured it might be a bit of work to add additional git services so I've mirrored the repo over to GitHub and released v1. Link to comment Share on other sites More sharing options...
ErikMH Posted June 6, 2021 Share Posted June 6, 2021 @Mike Rockett (& others), I think I must be missing something obvious here. Using the standard modules installer, I’ve installed Typographer 1.0.0 into my PW 3.0.179 installation (PHP 7.4.19), and configured many of its options. Two examples: smart quotes and smart ordinals. Following the example of TextformatterMarkdownExtra (which I have working), I “get” the module: $typ = $modules->get('TextformatterTypographer'); I then want Typographer to process the contents of a field “vsDetails” (in $item): $details = $item->vsDetails; $typ->format($details); echo "<p class='news'>$details</p>"; All this seems to work without error, but $details is echoed unmodified: foot symbols used as apostrophes remain “'” and “2nd” remains unchanged (the “nd” is not superscripted). The whole site is in debug mode; Tracy is installed (but I don’t really know how to use it yet). If I make other changes to the page, they’re immediately apparent, so I’m pretty sure caching isn’t an issue. (And just to be sure, I deleted the contents of /site/assets/cache/ ) I see that it’s possible to turn Typographer off for certain elements and classes; the text I’m feeding it is not from any of those, but I’m really not sure how it would know one way or the other. I’m taking this as another sign that I’m missing an important concept. FWIW, I can run the TextformatterMarkdownExtra module on the same text in the same way, and it works perfectly. Thanks for any help or pointers you can give! Link to comment Share on other sites More sharing options...
Mike Rockett Posted June 6, 2021 Author Share Posted June 6, 2021 @ErikMH – Hi Erik, The module wasn't intended to be used manually like that. Normally, you would apply the module as a formatter for the field in question by modifying the field's configuration. Under the hood, the formatValue method is called, which imports the vendor packages and runs the formatter. I guess if you wanted to, you could call this method manually, but you would need to pass in an instance of the current page and field. Here is the method signature that it uses: public function formatValue(Page $page, Field $field, &$value); The value is passed in by reference. I guess I can see that there might be use-cases for calling the method outside of the PW field system, so I reckon I should add a method to format arbitrary strings without the page and field dependencies (which are not used anyway - it's just the method signature that PW uses for formatters). 1 Link to comment Share on other sites More sharing options...
Mike Rockett Posted June 6, 2021 Author Share Posted June 6, 2021 1.1.0 released with support for formatting text outside of the field context. You can now use the following to format arbitrary text: print $modules->get('TextformatterTypographer')->formatString($text); Note that this new method does not use by-reference passing of the input text. 2 Link to comment Share on other sites More sharing options...
ErikMH Posted June 6, 2021 Share Posted June 6, 2021 Thank you so much for your quick response, @Mike Rockett! Long-time developer here, but very very new to ProcessWire. I’d suspected I was calling the module in the wrong way — and clearly I was right! So, thank you for adding the new method, but in fact I’ll look into configuring the field to use it as a formatter; I’ll bet that’ll be more efficient in terms of caching (and using a reference!) than what I was trying to do! I’m loving ProcessWire, but there’s a lot to learn.... 1 Link to comment Share on other sites More sharing options...
gornycreative Posted June 17, 2023 Share Posted June 17, 2023 Hi @Mike Rockett I just tried installing this on a dev version of pw 3.0.220 and it seems the new module overhaul might have picked up strange behavior: I mentioned this in a thread of Ryan's also as I'm not sure where the incompatability lies. I also noted that php-typographer has advanced to v6.7.0 which includes some php 8.1 deprecation resolutions. 1 Link to comment Share on other sites More sharing options...
gornycreative Posted June 17, 2023 Share Posted June 17, 2023 Changing line 40 in TextformatterTypographer.module.php from: public function getModuleInfo() { return json_decode(file_get_contents(__DIR__ . '/TextformatterTypographer.info.json'), true); } to: public static function getModuleInfo() { return json_decode(file_get_contents(__DIR__ . '/TextformatterTypographer.info.json'), true); } resolved the installation issue. 2 Link to comment Share on other sites More sharing options...
Mike Rockett Posted June 30, 2023 Author Share Posted June 30, 2023 Thanks @gornycreative I'll see if I can get a new version published this weekend. 1 Link to comment Share on other sites More sharing options...
Mike Rockett Posted July 1, 2023 Author Share Posted July 1, 2023 Version 2 of this module has been published. It now has support for Composer (via composer-installers). PW >= 3.0 and PHP >= 7.4 is now required. Dependencies updated. Please let me know if you bump into any issues. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now