Re: [fpc-pascal] Add API to official documentation search

2019-11-17 Thread Bo Berglund via fpc-pascal
On Sun, 17 Nov 2019 23:35:34 +0100 (CET), Michael Van Canneyt
 wrote:

>I will of course need to update the database when we release 3.2 and I update 
>the
>docs.
>

I had a look at it too and searched for baseunix fpopen etc.
Found this:
https://www.freepascal.org/docs-html/rtl/baseunix/fpopen.html

Look at the example, specifically the top comment of the example:

{ Program to demonstrate the fdOpen, fdwrite and fdCLose functions. }

Is this a typo or indication of early, later changed naming
convention?
Should be fp at the start of the names rather than fd, right?


-- 
Bo Berglund
Developer in Sweden

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Add API to official documentation search

2019-11-17 Thread Dmitry Boyarintsev via fpc-pascal
On Sunday, November 17, 2019, Graeme Geldenhuys <
mailingli...@geldenhuys.co.uk> wrote:
>
> Either way, that's a pie in the face for Embarcadero. :-)
>

They probably asked Embarcadero the same question for Delphi language
reference

thanks,
Dmitry
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Add API to official documentation search

2019-11-17 Thread Ralf Quint via fpc-pascal

On 11/17/2019 2:41 PM, Graeme Geldenhuys wrote:

On 17/11/2019 10:31 pm, Michael Van Canneyt wrote:

Stated purpose was special handling in the Bing search engine.

Either way, that's a pie in the face for Embarcadero. :-)

They might rather get a chuckle out of it, after all, it is Bing. And as 
you should know, friends don't let friends use Bing! :P


Ralf ;-)

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Add API to official documentation search

2019-11-17 Thread Graeme Geldenhuys
On 17/11/2019 10:31 pm, Michael Van Canneyt wrote:
> Stated purpose was special handling in the Bing search engine.

Either way, that's a pie in the face for Embarcadero. :-)

Regards,
  Graeme

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Add API to official documentation search

2019-11-17 Thread Michael Van Canneyt



On Sun, 17 Nov 2019, Graeme Geldenhuys wrote:


On 17/11/2019 10:20 pm, Michael Van Canneyt wrote:


That would be me.


Thought that much. ;-)



And there already is an API. How else ? This is Free Pascal !


If you look in the browser developer console when using that page,
you'll see there are 2 calls available which do return JSON.


My bad, I initially thought Ryan was simply quoting the FPC docs URL
with a "wish for a search URL". It's only after I sent my first reply
that I actually clicked on the URL and noticed the search box. Very nice
to see it available now.

How is the search data generated - via fpdoc? What storage format does
it use?


Postgres database. the data is generated once from the HTML using fpindex.
All is in SVN. packages/fpindex.

I will of course need to update the database when we release 3.2 and I update 
the
docs.


I remember years ago I found a JavaScript search engine that could be
integrated with fpdoc's HTML output, but that storage format was
JavaScript (if I remember correctly) and was huge.


Well, that would also have been an option, but I thought it would be nice to
showcase that FPC has all the tools you need for whatever task you set it

Never miss a chance to show off what FPC can do ;-)

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Add API to official documentation search

2019-11-17 Thread Michael Van Canneyt



On Sun, 17 Nov 2019, Graeme Geldenhuys wrote:


On 17/11/2019 10:22 pm, Michael Van Canneyt wrote:

Even Microsoft asked official permission to use our website as pascal reference.


For what need? VS Code?


Stated purpose was special handling in the Bing search engine.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Add API to official documentation search

2019-11-17 Thread Graeme Geldenhuys
On 17/11/2019 10:20 pm, Michael Van Canneyt wrote:
> 
> That would be me.

Thought that much. ;-)


> And there already is an API. How else ? This is Free Pascal !
> 
> 
> If you look in the browser developer console when using that page,
> you'll see there are 2 calls available which do return JSON.

My bad, I initially thought Ryan was simply quoting the FPC docs URL
with a "wish for a search URL". It's only after I sent my first reply
that I actually clicked on the URL and noticed the search box. Very nice
to see it available now.

How is the search data generated - via fpdoc? What storage format does
it use?
I remember years ago I found a JavaScript search engine that could be
integrated with fpdoc's HTML output, but that storage format was
JavaScript (if I remember correctly) and was huge.


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Add API to official documentation search

2019-11-17 Thread Graeme Geldenhuys
On 17/11/2019 10:22 pm, Michael Van Canneyt wrote:
> Even Microsoft asked official permission to use our website as pascal 
> reference.

For what need? VS Code?

Regards,
  Graeme

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Add API to official documentation search

2019-11-17 Thread Michael Van Canneyt



On Sun, 17 Nov 2019, Ryan Joseph via fpc-pascal wrote:


Could FPC make an API for the official documentation search at 
https://www.freepascal.org/docsearch/docsearch.var so we could make calls like:

https://www.freepascal.org/docsearch/docsearch.var?word=List

and get back a JSON object that had the search results? This is important for 
integration with 3rd party IDE's.


See my response to Graeme.

Even Microsoft asked official permission to use our website as pascal reference.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Add API to official documentation search

2019-11-17 Thread Michael Van Canneyt



On Sun, 17 Nov 2019, Graeme Geldenhuys wrote:


On 17/11/2019 4:29 pm, Ryan Joseph via fpc-pascal wrote:
at https://www.freepascal.org/docsearch/docsearch.var 


Good to see Free Pascal now actually has searchable online docs (without
the help of Internet Search Engines). That's a big step up from a few
years ago. Well done to whomever was involved in that!


That would be me.

And there already is an API. How else ? This is Free Pascal !


If you look in the browser developer console when using that page,
you'll see there are 2 calls available which do return JSON.

for dropdown completion:

https://www.freepascal.org/docsearch/docsearch.cgi/list?t=contains&m=1&q=as
https://www.freepascal.org/docsearch/docsearch.cgi/list?t=contains&m=1&q=al

q is the query parameter. m=1 requests metadata. m=0 omits metadata.

For actual search there is

https://www.freepascal.org/docsearch/docsearch.cgi/search?m=1&q=equals

again, search term is in 'q'. m has the same meaning.

The JSON is straightforward.

But I will document the API.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Add API to official documentation search

2019-11-17 Thread Graeme Geldenhuys
On 17/11/2019 4:29 pm, Ryan Joseph via fpc-pascal wrote:
> at https://www.freepascal.org/docsearch/docsearch.var 

Good to see Free Pascal now actually has searchable online docs (without
the help of Internet Search Engines). That's a big step up from a few
years ago. Well done to whomever was involved in that!

Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Add API to official documentation search

2019-11-17 Thread Graeme Geldenhuys
On 17/11/2019 4:29 pm, Ryan Joseph via fpc-pascal wrote:
> https://www.freepascal.org/docsearch/docsearch.var?word=List
> 
> and get back a JSON object that had the search results? This is
> important for integration with 3rd party IDE's.

No such API exists (that I know of), but the desire to integrate the
FPC, LCL, fpGUI and any other API documentation into other IDE's and
Programming Editors has existed for over a decade (by me at least). I
also needed the requirement of having the help available offline,
because I often worked in locations with no internet access. I'm of the
rare breed of developers that actually reads documentation. ;-)

That's why I invested months of research in various help formats and
eventually spent over a year developing a help viewer that could easily
integrate into IDE's and Editors, and even be used from the command line
or via IPC calls. The help viewer is now the default help viewer of
fpGUI, and is called DocView.

It used the INF help format (initially developed by IBM), which is
extremely compact, really fast, supports full text search. DocView takes
full advantage of all that and can concatenate multiple help files and
their Tables of Content at runtime, supports advanced searching,
bookmarks, inline annotation and more.

Details on integrating Docview in various IDE's and editors:

   http://fpgui.sourceforge.net/docview_ide_integration.shtml



Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Add API to official documentation search

2019-11-17 Thread Ryan Joseph via fpc-pascal
Could FPC make an API for the official documentation search at 
https://www.freepascal.org/docsearch/docsearch.var so we could make calls like:

https://www.freepascal.org/docsearch/docsearch.var?word=List

and get back a JSON object that had the search results? This is important for 
integration with 3rd party IDE's.


Regards,
Ryan Joseph

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal