Would someone consider making this plugin? [text formating library]

Text formatting library that supports BBCode, HTML and other markup via plugin. Handles emoticons, censors words, automatically embeds media and more.

Could anyone please integrate this for grav?

here are some docs: http://s9etextformatter.readthedocs.org/

I’m unfortunately not a developer, so I have no knowledge of how to do it,
but this would be a great plugin - supporting not only vimeo/ytube, but also twitter, fb, tumblr & other media integration.

Would be very easy to do. Are you sure you are not willing to try it??? Make a great first Grav plugin project for anyone.

BTW, would be very similar to SmartyPants plugin that already exists.

Hi @ameo,

although I and the whole Grav Team have a lot of work, I’ll put it on my list. If no one is faster, than you will see this as a plugin shortly in the GPM here. Due to its feature richness, the first release may only support a subset of the library, which will be extended then in later versions.

Bye,
Sommerregen

FYI I’ve started integrating TextFormatter as a plugin into Grav (see the screenshot here http://screenshot.net/l07olf0.jpg ). As you can see, it’ll be fully customizable and will expose almost all options from TextFormatter. Still I have to test it and write some documentary stuff, before I can actually release it. Hopefully in a fey days it will be finished :-/

this will be 1 hell of a plugin :slight_smile: can’t wait to use it!!!

Wow that does look pretty awesome @sommerrgen

Dear @ameo,

today I released the TextFormatter plugin. It will be up soon in the GPM. By default it formats all contents in the format

[plugin:textformatter](...content...)

If you set process: true or process.textformatter: true in the page header, then TextFormatter will process the whole page content. It can be highly customized. Feel free to star, fork, like it etc.

Enjoy,
Sommerregen

I’m checking daily for this post! :slight_smile: Thank you so much, this oughta be a great plugin! :slight_smile:

Sorry that you have to wait for so long. At first I thought, it will be easy to implement. But after I’ve seen the documentation I thought an easy implementation is not worth the effort and instead I’m doing it the right way. However this plugin is now a “feature monster”. Maybe this is the best integrated plugin in Grav, too, due to its capabilities (extends a process option, is available through [plugin:textformatter](...), has a twig filter etc.).

I hope the wating time was worth it. I’m feeling sorry for the delay if not.

I must say I am very confused. Think of me more as an end user, which I am.
So, I noticed 1.) this plugin is not available (yet) in list of Available plugins

That didn’t stop me - I downloaded it and installed through FTP.
And activated.
2. First thing I noticed upon installation - my edit screen is shaking sometimes when I hover with mouse probably in wrong place, which is a bit annoying, and I have trouble selecting text, and placing cursor to right point where I want it to be.
3. One of the most important things this plugin can is to embed tweets, and youtube, and other media. But I’m confused why when I place whole link in text field, on frontpage I get output that displays that video/tweet, but also in front of it is part of code:
![plugin:textformatter](

did I not do something that I should do?

Hi @ameo,

referring to your questions:

1.) is already solved (see here http://getgrav.org/downloads/plugins ). After @rhukster has add it to GPM it will take around 1-2h to catch it up. On your local install it will even appear later, since Grav is caching the repository for one day. But you can force to renew it with e.g. bin/grav update -f.

2.) This needs more clarification. Is your cursor shaking in admin panel? Then it has most likely something to do with the admin panel https://github.com/getgrav/grav-plugin-admin , because TextFormatter is inactive in the admin panel.

3.) You have to use e.g.

—markdown
plugin:textformatter


In your case you used the exclamation mark, which is not right here. Even if you embed things you write it in Markdown as a link with this special "alt" attribute `plugin:textformatter`. That's Grav sepcific. [Page Inject](https://github.com/getgrav/grav-plugin-page-inject) works the same.

Sorry, for 2.) it has to be

[plugin:textformatter]([youtube]http://www.youtube.com/watch?v=QH2-TGUlwu4[/youtube])

In addition if you want to test it, I included a demo page in the plugin’s repository https://github.com/Sommerregen/grav-plugin-textformatter/blob/master/_demo/pages/01.blog/textformatter/item.md . You may copy and paste it into your pages folder and test it.

Let me show you; this is what I have in content block:
Doesn’t matter is it this:
[plugin:textformatter](http://www.youtube.com/watch?v=QH2-TGUlwu4)
or this:
[plugin:textformatter]([youtube]http://www.youtube.com/watch?v=QH2-TGUlwu4[/youtube])

my demo turns out like this:
http://www.fiber.p4o.net/demo

Ah, I see. That’s possibly a bug. Can you change L131 of textformatter.php to

$content = $matches[1];

and L136-141 of textformatter.php to

$raw = $function(['',
   // Parse links (strip markup from content)
   $this->parseLinks($raw, function($matches) {
      return $matches[1];
   })
]);
---

it was a bug indeed, and this fixed it.
this
[plugin:textformatter](http://www.youtube.com/watch?v=QH2-TGUlwu4)
works just fine.

Thank you very much :slight_smile:
Could you please tell me how to set up path for smileys, now?
I’ve put my smileys in folder user/data/xen and I’d like them to display.

Great to hear! I will fixed it today and release a new version.

concerning your question the best is to set your emoticons path to user://data/xen in the admin panel. From there you can add each icon in the format <acronym>: <filename.extension>. Provided you have an icon user/data/xen/smile.png then add an icon with

":-)" : smile.png

to replace all emoticons with “:-)” in the text with your respective image.

unfortunately, that did not work?

Also, somewhat unrelated, I chose emojione, chose :headphones:
that also doesn’t display.

It should work. I tested this with another smiley set. It seems like you have switched of emoticons. But I guess the problem lies somewhere else… Did you set process: true in the TextFormatter configuration page. If not I strongly recommend it. Oterwise you have to use e.g.

[plugin:textformatter](:wtf:)

for every emoticon!

Concerning your “Emoji” choice: only unicode characters are replaced with imags. See the docs http://s9etextformatter.readthedocs.org/Plugins/Emoji/Synopsis/ .

@Sommerregen
Did you set process: true in the TextFormatter configuration page.

well, that was the issue whole time, in everything, apparently.
now I can post links normally, and they convert, and smileys and emoji also. :slight_smile:

maybe this should better be set as true, upon installation?
that way it would be ‘out of the box’.

Thank you a lot for your help, locating the issue,
and most of all, for making this great plugin.