typemill / typemill

Typemill is a lightweight, flat-file CMS designed for simple, fast, and flexible website and eBook creation using Markdown.
https://typemill.net
MIT License
427 stars 60 forks source link

Plugin thesaurus #173

Closed ghost closed 4 months ago

ghost commented 3 years ago

Thanks for the clarification and the offer for my backlink in 167: if I need it I will keep it in mind, for now I sincerely thank you.

(Different requests in the same tichet? Maybe you don't like it, because I see that you open a ticket for every single problem for yourself. For the future, if you like single tickets for single issues, I adapt.)

trendschau commented 3 years ago

Hi iusvar,

thank you!

In general I prevery 1 ticket for 1 issue so it is easier to close and track them. But totally fine to make exceptions from a rule :D

ghost commented 3 years ago

Hi trendschau,

I was the one who didn't know the acronym a11y, in the translation it's still accessible, I didn't know it meant "accessibility". If you want you can leave it as it is.

For the favicon it's my mistake, I hadn't noticed.

For the versions, excellent, up to 1.3.8, I add it too.

I will immediately make another exception to the rule: I have just uploaded a first plugin thesaurus. If you have time I would be pleased if you took a look at it for an opinion

trendschau commented 3 years ago

It looks awesome! But i did not get it to work yesterday because sqlite3 was missing on my machine. I will try again this evening.

ghost commented 3 years ago

I just added an alternative to sqlite3: after setting the plugin you can use the original dat file (I only changed the filenames)

trendschau commented 3 years ago

I tested it and it works great!! To be honest, I did never try to use a plugin to inject some functionality into the raw editor, that is pretty fantastic, because it might also be possible to create a plugin with a code-editor for the raw mode. So I really love it!

I found only two notices in the response from the xhr-call:

Notice: Constant DS already defined in /var/www/html/typemill/system/Translations.php on line 9

Notice: A non well formed numeric value encountered in /var/www/html/typemill/plugins/thesaurus/index.php on line 43

And I am not sure if the very generic variables in the script.js like "start" or "end" will interfer with other plugins soon, maybe it is better to use some plugin-special prefixes like "thesaurus-start" or something like that?

ghost commented 3 years ago

I'm glad you like it, always for the raw environment I'm also doing other things, a simple counter of characters, words, sentences and time to read the text.

I became interested in this environment because the content is concentrated in a single html container. But my intention is to make both the thesaurus plugin and the counter plugin available in both environments.

I really thank you for the feedback regarding the warnings: I'll take a look.

For the names of the start and end variables you are absolutely right, I will use this advice as a rule to follow for something else.

Also, I think I have never written it, I appreciate the work you are doing with Typemill, really excellent.

ghost commented 3 years ago

The first warning I have already solved with the commit restores uniformity

For the second warning I proceeded by changing from $number = $pieces[1]; to $number = intval($pieces[1]);

Thanks

trendschau commented 3 years ago

Thank you very much for your kind words!

Let me know when it is ready for production, I can add it to the plugin directory next week if it is fine for you

ghost commented 3 years ago

Okay for me, so thank you.

trendschau commented 3 years ago

sorry, I had a lot of family business, but now I am back at work and will add the great plugin to the plugin directory this week :)

ghost commented 3 years ago

no problem, do it when you can, and thanks again :-)

trendschau commented 3 years ago

Hi iusvar,

I added the plugin to the plugin-directory now: https://plugins.typemill.net

Not 100% sure but in my tests with the current release 1.3.7.1 it still produced some errors:

Anyway, thank you for this great contribution :)

ghost commented 3 years ago

Hi trendschau,

Thanks for doing it.

For the first point, I had already restored the use of DIRECTORY_SEPARATOR with the commit restores uniformity in develop (which I imagine will be combined with master in the next version).

For the second, I will go into the matter.

it's nice to be able to add functionality to your very useful project :)

trendschau commented 3 years ago

Hi iusvar,

thank you, yes, it will be published with next release, but next release (acl/user-management) will probably take some time :)

ghost commented 3 years ago

As long as it takes, the next release will be another important step, good job :)

ghost commented 3 years ago

Hi trendschau,

I have just made a small change, version 1.0.2, which I believe can resolve what you have reported to me.

In this regard, helping me with an image, I will illustrate the functionality that the plugin should follow. thesaurus

The synonyms of the chosen word appear in the selected part in green. By positioning the mouse over each of these words, the words relating to the synonym on which the mouse pointer is located appear in the selected part in red: the modification takes place only if you click on the words displayed in the part colored in red. When I say ON THE WORD I mean EXCLUSIVELY ON THE WORD, and not on the white space because in this case the windows disappear without any change. The window disappears even if you click on the part selected in green.

I hope I have expressed it in decent English.