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.
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.
This is the post where I wrongly noted this as a plugin. (Note the post is only accessible by admins).
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
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.
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).
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
"summary":"True if Elem is a member of List.",
$ curl https://www.swi-prolog.org/doc_link?for=atom_codes/2
"summary":"Convert between an atom and a list of character codes.",
$ curl https://www.swi-prolog.org/doc_link?for=http_open/3
"summary":"Open the data at the HTTP server as a Prolog stream.",
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.