You can also reply with more than one item but each item must contain a word and a single corresponding link.
There is no guarantee that if you submit a candidate that it will used, changed or even used then latter changed.
To start I will let the candidates accumulate for several days and the appropriate discussions to take place.
Since this applies automatically to preexisting post if this causes problems let @EricGT know so that I can fix the earlier post to present as originally desired.
Nice! Only I see no links What I really would like is to make name/arity link to the docs. The only problem is that if we do this with just name/arity it will also create false link for all references to hypothetical/locally defined/… predicates and a regex covering the building and library predicates of SWI-Prolog is rather big (not hard to generate though). I thought we needed to build a plugin for that, but maybe it can be simpler.
If we had the ability to patch the code/inject some javascript to override, I guess it would be fairly simple to add an extra check to make a HEAD request for the URL & only generate the link if it gives a 200.
Most likely reason is that your theme setting is set to Default and needs to be changed. The steps are in the original post. As I just added this, a refresh of the page might be needed.
That is what I thought also, but in reviewing the list of themes saw this and gave it a quick test. You most likely received the idea that it required a plugin from one of my post of days gone by; so it is most likely my fault.
EDIT
This is the post where I wrongly noted this as a plugin. (Note the post is only accessible by admins).
Since Linkify words in post is a theme and open source at GitHub and we can install themes from GitHub, and themes can incorporate JavaScript you might be able to use it as a base and enhance it.
Oh, we can use arbitrary themes from github? I’ll try forking & making the change then, though I’m not sure how to go about testing locally without installing a whole Discourse thing.
That is what I expected to be needed. Only non-existing predicates gives a 200 page without documentation. Anyway, we can add an API call that returns the URL of the documentation (and possibly some more info such as whether the predicate is built-in or library, the summary docs (which we can add in a title attribute) etc). Then we first need to self-host I’m afraid.
First some naming conventions to keep things straight.
There are themes which I will call Primary Theme and Components which are also a theme and which I will call a Component Theme.
Currently this site has 4 primary themes: Dark,Light, Neutral and Default
Currently this site has 3 component themes:
Auto linkify words
DiscoTOC
Header Links Theme Component
Any user can set their primary theme as noted above.
Admins can install primary themes and component themes. During an install a theme can be selected from a partial list of the popular themes, from your device, from a Git repository (which doesn’t have to be GitHub), or you can create a new one.
For both Primary Themes and Component Themes in the Admin tool, when a specific one of them is selected on the right will appear the theme settings and at the bottom will be a button to Preview the change.
The Preview button gives you the ability to test it locally.
You will have to install the theme before you can get to the Preview button, but after having done this a few times I am more relaxed when doing it.
Since themes are just CSS and JavaScript running after the text for the post has been returned from the SQL query and does not update the database, AFAIK it is totally safe, the worse I expect you can do is mess up the single HTML page you are previewing.
Side note:
The process of installing and getting these themes to work was a bit confusing to me at first but now I am getting the hang of it. Still don’t know if/how I can update the Default theme, but will search/ask at meta Discourse.
We’ll also need to add CORS headers (ref 1, ref 2) to SWI-Prolog.org so we can use an ajax (ref) request to check the urls. I was trying to hack something together that just looks at the HTML to try to tell if it’s a real predicate, but I can’t even get that far right now, because of the lack of an Access-Control-Allow-Origin header (ref).
returning a JSON object holding a URL, a summary, a class (builtin, autoload, library), a library (if it is a library or autoload). For now we accept [module:]name{/|//}arity?
As the theme Default is not available in the admin’s themes page, for the theme Light I am selecting Theme is enabled by default
Hopefully this will make Light the new default and those who have not changed their theme setting will see the changes made by the added component themes as the component themes are included in the Light theme.
The check mark, which was not present in any theme, is now present for the Light theme indicating, based on what I read, that it is the default theme.
AFAIK, anyone can create a Discourse theme and we can use it here.
The common way to get Discourse themes is to find them in the Discourse theme list, find the GitHub link noted in the theme, then as an admin install the theme using the GitHub link.
As noted above there are additional locations that can be used for installing, GitHub, any Git repository including one on your system or another system, installing from a local system (I don’t know if/the required format). Also admins have an option to create a new one.
The only option I have used thus far is to install from GitHub.
And yes a user could suggest a theme be installed and they would be considered but this is not like a one day sale, there is no rush.
$ time curl https://www.swi-prolog.org/doc_link?for=member/2
{
"class":"autoload",
"library":"lists",
"summary":"True if Elem is a member of List.",
"url":"https://www.swi-prolog.org/pldoc/doc_for?object=member/2"
}
real 0m0.384s
user 0m0.005s
sys 0m0.005s
$ curl https://www.swi-prolog.org/doc_link?for=atom_codes/2
{
"class":"iso",
"summary":"Convert between an atom and a list of character codes.",
"url":"https://www.swi-prolog.org/pldoc/doc_for?object=atom_codes/2"
}
$ curl https://www.swi-prolog.org/doc_link?for=http_open/3
{
"class":"library",
"library":"http/http_open",
"summary":"Open the data at the HTTP server as a Prolog stream.",
"url":"https://www.swi-prolog.org/pldoc/doc_for?object=http_open/3"
}
The main worry is the round trip time. This is nice for you to experiment with. If we really go for it, the plugin should probably collect all candidates and then do a POST on this handler with a JSON array of candidate documentation links.