How did you do that?

All flavors welcome.
Forum rules
Be kind.
Post Reply
User avatar
richmond62
Posts: 2838
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

How did you do that?

Post by richmond62 »

I do wonder if Elvis has left the building: it would at least be polite to keep your supporters informed of any decisions in this regard that you may have taken.

I should be grateful, even if for nothing else, if you could let me/us know how you'got at' the dictionary files to edit them.
-
Screen Shot 2023-08-21 at 21.05.27.png
Screen Shot 2023-08-21 at 21.05.27.png (291.11 KiB) Viewed 4595 times
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 1607
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: How did you do that?

Post by tperry2x »

Hi Richmond,
Sorry if I'm being thick (as is more likely than not), but is this message for Paul to answer?
I haven't dabbled with replacing anything or building a version of anything as yet.

Over on the Linux-side-of-things, I can see that when I open the dictionary, it pops the documentation into a folder called 'documentationcache'

This is located at: file:///home/username/.runrev/documentationcache/9_5_0_community/api.html

So, I'd probably start replacing things in there. I'll give it a go and see if my changes 'stick' between attempts...
User avatar
tperry2x
Posts: 1607
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: How did you do that?

Post by tperry2x »

Searching file contents, in that documentationcache folder:
Image
Returns 83 matches, so I'll try changing one of these as a before-and-after, and see what happens.
(yes, I'm using an older version of Livecode - just for reliability... if that can be considered a thing).
User avatar
tperry2x
Posts: 1607
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: How did you do that?

Post by tperry2x »

I picked the first on the list, the api.html (seemed a good target), and changed the title from livecode to something more fitting:
Image

And amazingly, my logic seems to hold up, that yes - this is where you'd go about changing the dictionary files (at least on Linux).
Image
(note the tab name has changed accordingly). So, I guess it's a matter of running a find & replace (albeit being careful when doing so), on the Livecode dictionary files in this location. (obviously changing the path to the appropriate version and wherever it is on a Mac) - probably in a ~/Library/Application Support folder somewhere I'm guessing?
User avatar
tperry2x
Posts: 1607
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: How did you do that?

Post by tperry2x »

However, interestingly (and not that surprisingly), when I relaunch livecode and open the dictionary again, it's defaulted back to 'Livecode Dictionary' and not 'FoolsErrand'.. so, seems like it was a fool's errand after all. It's obviously popping the dictionary files back in there upon each launch (why?) but it must copy them from somewhere.

I'm guessing from /opt/livecode/livecodecommunity-9.5.0.x86_64
but there's so much spurious stuff in there, it's hunting through that lot. There also seems to be a few rev stacks in there too.
User avatar
richmond62
Posts: 2838
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: How did you do that?

Post by richmond62 »

Oh, when we are on the subject of Fools' errands (note the way I moved the apostrophe to after the 's'), some people pushed me to the 'RunRev' folder in the 'user' folders on the OS: and it turns out that they are continually 'corrected' every time one opens an IDE: so there is NO point whatsoever mucking around with anything outwith the IDE package . . . as I explained over here:

https://forums.livecode.com/viewtopic.p ... 6&start=15

JUST [ha, ha, ha: headaches, curses, and so on] dig around for yourself INSIDE the IDE . . . after all, you download the thing from the internet, it then spreads its 'gubbins' into odd places on your computer, and continues to do that, so nothing linked with the IDE outwith the IDE is ever static.

So . . . you are very welcome to take small comfort in the fact that I am also a 'foolish baboon', not helped by the fact that some of the 'eggspurts' (largely self-proclaimed) "over there" are quite capable of either:

1. Getting things badly wrong.

2. Possibly misleading people like Thee and Me (reminds me of the professor of Old Churxh Slavonic who started spreading sh*t about my program for inputting that language in Glagolitic because, unlike her I did not have a doctorate copied from somewhere).

So, as ever throughout my life (like when a professor of Sanskrit at Durham University told me that one could learn the language WITHOUT bothering to learn the main writing system . . . silly prawn: if you don't believe me try and read the Kumara-Sambhava in Devanagari 'knowing Sanskrit' in Latin transliteration only . . . what a load of utter bollocks), I have got "down and dirty" without paying THAT much attention to the burblings of self-satisfied fossils. I have been kicked by cows several times; but at least the cows kicked me because I offended them because I made my own mistakes, not because I listened to some professor of agriculture who had never got their paws dirty, let alone touched an udder. Had a cow kicked me because I got something wrong because some prof. told me to do something 'that way' I would have gone and kicked the prof.; the fact that cows always kicked me because I caused them discomfort owing to my own fault meant that I could kick no-one, just apologise to the cows.
-
balls.jpg
balls.jpg (55.82 KiB) Viewed 4581 times
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 1607
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: How did you do that?

Post by tperry2x »

So, looking at it from the other way:
I edited the "api.html.template" file in "/opt/livecode/livecodecommunity-9.5.0.x86_64/Documentation/html_viewer"
Image

I added foobar to the title.
Opened Livecode afresh, and opened the dictionary:
Image
Ta-da! - so, yes. It's copying it's files from here at least on Linux.
User avatar
richmond62
Posts: 2838
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: How did you do that?

Post by richmond62 »

Well, what with your method pointing one way, and mine the other, chances are we'll MISS in the middle. LOL

My crticism if your method is that it does not result in anything that can be easily distributed.
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 1607
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: How did you do that?

Post by tperry2x »

richmond62 wrote: Wed Aug 23, 2023 1:14 pm My crticism if your method is that it does not result in anything that can be easily distributed.
That's an absolutely valid criticism, and I completely agree.
You are right. If I'm doing my own thing, and you another - then all our efforts are going to be duplicated & mismatched.

Of course, this is where the benefit of using github would come in (with a version control system), if only I understood how to use it properly rather than just downloading everything from it (I'm using it as a glorified ftp server), but I get that it can track changes somehow - but never been able to wrap my head around how it is supposed to work.

I can also see that Paul has changed things a little over 2 weeks ago on there, to do with the music libraries and such, so if I do anything, I'd like to use his codebase and I'd also like to replace all instances of the word Livecode on the github version, but I just don't know how I'd start.

No, this was just me messing around on my own Linux copy to see if I can indeed make any changes that would stick. I've reverted the changes since as I was only playing about.

I don't know enough about the inner workings of this thing to really start tinkering with it to the level it needs. (If I can't wrap my head around github, what chance have I got with changing the OXT project in there). :|
User avatar
richmond62
Posts: 2838
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: How did you do that?

Post by richmond62 »

You did not understand my criticism the way I meant it.

(And I should apologise for my terrible typing: but my fingers and my Android phone do not work well together.)

THIS, being typed on my swanky, new-for-you, iMac is like Mary Poppins: "Practically Perfect in Every Way." :P
If I'm doing my own thing, and you another - then all our efforts are going to be duplicated & mismatched.
Personally the idea of duplication and mismatching appeal to my sense of humour: let's have:

OXT

tperryCode

rmCODE

frankensteinCode [This one sounds like great fun.]

RevolutionREBORN

revolutionRECORE

runtimeRASPBERRY

DeadCode !!!!

and many many more, just as, as far as I understand, there were many, many types of pre-humans before we emerged, and, as they now
have worked out, people like me, from Western Europe, have about 5% Neanderthal genes in me (explains my slightly caveman attitude at times).

After all, if lots and lots of people have a go, "Homo Sapiens" may yet emerge from the mess. 8-)

In the Vedanta Sutra it is stated that at one time there were some 33 million types of human: taking into account a 'slight' case of Hindu exaggeration, coupled with the Bible stating that we are the result of humans and giants 'getting it on together', it seems to me that both of those books contain some sort of folk memory which might just be telling us about the benefits of hybrid vigour . . .

NO! I am not starting a new cult, even thought I have guru-like tendencies I keep having to slap down.

----------------

The point I was trying to make is that if we 'twiddle around with' LC documents outwith the IDE, when we then attempt to send our modded IDE to someone else the modifications will NOT go with it because they are NOT inside the IDE.
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1636
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: How did you do that?

Post by OpenXTalkPaul »

richmond62 wrote: Mon Aug 21, 2023 6:08 pm if you could let me/us know how you'got at' the dictionary files to edit them.
I did go into this a bit, way back when I first started editing those (actually Seth did some of those edits in the beginning).
The way it is intended to work is you edit the .lcdoc (markdown) files that are in the Engine repo (get from GitHub), then use the Builder stack that's in a Builder folder (from same repo) which compiles them all into sqlite database files, which in turn is used to generate that cache of web files (html/js), which is what are actually used by the Dictionary stack to display in it's browser widget. Same with the .md markdown files that are used to build the guides in the guides tab.

The dictionary stack is actually dynamic, so when you add a new library or widget extension that includes documentation, those docs / guide are parsed and added to the dictionary on the fly during installation of the newly added extension.

There's a few alternative dictionary stacks that use the sqlite database file directly and don't use the browser widget at all. I'd like to include my version of an alternative dictionary, most useful for certain Linux setups that have trouble with the browser widget based dictionary stack. I tried to make my prototype more compact. None of these alt-dictionary display the 'guides' tab info though.
User avatar
richmond62
Posts: 2838
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: How did you do that?

Post by richmond62 »

Is there any way to read those BLOBs of binary data in the api-sqlite file for the Dictionary directly?
-
Screen Shot 2023-08-25 at 22.53.54.png
Screen Shot 2023-08-25 at 22.53.54.png (195.85 KiB) Viewed 4505 times
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1636
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: How did you do that?

Post by OpenXTalkPaul »

richmond62 wrote: Fri Aug 25, 2023 7:54 pm Is there any way to read those BLOBs of binary data in the api-sqlite file for the Dictionary directly?
-
Screen Shot 2023-08-25 at 22.53.54.png
Sure, just read the binary data from the file and process the bytes however you want? Not sure why you would want to? That seems a bit like reinventing the wheel to me. Why not just use the revDB external to read/edit the sqlite file? Or use one of various open source SQL tools that are around? I use "DB Browser for SQLLite" to look at the contents via GUI.
User avatar
OpenXTalkPaul
Posts: 1636
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: How did you do that?

Post by OpenXTalkPaul »

tperry2x wrote: Wed Aug 23, 2023 4:43 pm
richmond62 wrote: Wed Aug 23, 2023 1:14 pm My crticism if your method is that it does not result in anything that can be easily distributed.
this is where the benefit of using github would come in (with a version control system), if only I understood how to use it properly rather than just downloading everything from it (I'm using it as a glorified ftp server), but I get that it can track changes somehow - but never been able to wrap my head around how it is supposed to work.
I'm not really good with GitHub and I tend to use it more like n FTP/a free cloud file host, helpful when I'm working on a project using different machines from different locations. It has come in very handy for reverting files back to a previous versions, so it can be used a bit like a 'time machine' backup I suppose.

The problem with xTalks and version control systems (and 'diff' tools) is that they typically don't look into the contents of binary files when they don't recognize the file format, such as a binary 'stack' format, which is part of why team LC Ltd. spent some time refactoring the IDE, separating the old binary stack UIs from their scripts, into one or more script-only-stack (a text file that GitHub can track) of 'behavior script' and one ( or none) binary stack file containing the graphical controls objects. Some script-only stacks may generate their UIs on the fly, the way the newer versions of the Tools palette or the ephemeral Property Inspector palettes work.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests