on linkify or abbr plugin ?
Linkify should be better as a starting point.
Youâd need to modify this function:
I just did a google sheets api
integration for @jrgong so that the linkify data can be fetched from a google sheet. It needs some more work before I launch it on meta though.
I did fork the TC in the process. I was wondering whether any data hook can be provided in the TC to switch/add data sources from another plugin or TC? I can make a PR but havenât seen such a pattern earlier. Maybe something on the lines of replaceDataSource
or addDataSource
methods in the plugin api.
Isnât it easier to just add an extra theme setting?
new setting for what?
For the integration with GSheets? Iâm not sure I got what youâre asking but it seems to me it would be easier if you could submit a PR merge your changes upstream.
The integration is in form of a plugin as we need to authenticate for bringing data from the sheet. Also the data needs to be cached to the db in order to avoid API calls for every post.
if I write safe-mode here in meta, it gets linked automatically to the related topic (note that I havenât hyperlinked any words as can be seen in the image, Iâve only written safe-mode
).
is it a result of this theme (adding some topics and the related word) or is it some kind of new magic which hasnât been announced yet ?
Yeah this is the component and a very handy usage of it
@codinghorror this is a pretty legitimate reason for wanting this in core, if we had this in core we could implement back links for cases like this, the component can not do this, only plugins
Thatâs fine as long as it is in the Watched Words area, where it should beâŚ
I use linkify to transform url to affiliate link, and I just found that it transform user email too.
Ex : If someone has an email like helen@amazon.com and I have a linkify affiliate link with amazon (ex : amazon.com/affiliate35)
It transform the email like that : helen@amazon.com/affiliate35
and people donât receive emails.
If someone have an idea to exclude user email with the âexcluded tagsâ & âexcluded classesâ options.
Thank you
Here is an idea that might be super useful and easy to implement:
How about adding a third setting to each line for a custom CSS class?
That way one can change the looks for each individual link.
In our particular case, we want to have different looks for:
- product links and even product categories -> affiliate links to partner shops
- technical terms -> glossary entry
- internal pages -> toc, faq, beginner-guide, etc
In the past we just installed a second instance of linkify component and adjusted the css class in the component. That way itâs not update safe and has to be edited manually with each update.
In addition we are using a custom fork with a google sheet to manage the entries (kudos to @fzngagan and thepavillion team )
Hey @jrgong weâre in discussion and planning to launch the plugin to the world with instructions.
Hey guys
how does the theme component deal with somewhat similar or overlapping regex matches
In my specific case I have following entries
/super.?skunk/gi,https://link1.com
/skunk(?:(?: #?|#)?1)?/gi,https://link2.com
For the term super skunk
current output is: Super Skunk
Desired result is: Super Skunk
How can I achieve that?
You can try changing the order of regexes in the theme settings.
ne 23. 8. 2020 v 19:06 odesĂlatel jrgong via Discourse Meta <meta@discoursemail.com> napsal:
This theme component only works for a list of static associations between words and a url as defined in a google spreadsheet or defined through the admin panel. What if there was a pattern of words that would connect to a url using a javascript? For example, âName1â would be connected to âurl/1.jpgâ where the association between âName1â and â1â would always be the same but would be defined through an api?
Not sure what you mean but the theme component is written entirely in JS so youâll welcome to modify it as needed.
Can u share this plugin?
Our site has something like this that another admin created.
The site is for the Programming language SWI-Prolog and in post we regularly refer to the predicates (think methods in imperative languages) and the predicates are distinquished by the number of parameters which is a number. So regularly we input append/2, append/3, append/2,3 etc. Before the custom plug-in we spent a measurable amount of time inserting the links to the documentation by hand, e.g. append/2 append/3.
When a predicate name with the arity are combined together they are called a predicate indicator.
With the plug-in, now we just input the predicate indicator and the link is added automatically.
Our site is open and has test page that demonstrates this is action.
See: Post for testing installed component themes and plugins
( Auto linkify Prolog predicates)
The plug-in is on GitHub but required some changes on the documentation server to make it work.
See: jamesnvc/ discourse-linkify-prolog-predicates
Please donât ask me questions about this as I only know it works. Yes I could figure it out if I need to but that would take me a few hours that I donât have.