* Plugin code snippets in the KB
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Plugin code snippets in the KB
I've reviewed the Plugin Code Snippets in the KB and marked most of them as compatible with FH7 as well as 5 & 6.
I have some queries if anyone cares to take a look:
https://fhug.org.uk/kb/code-snippet/uni ... functions/ We have utf8 support in Lua 5.3 plus the utf8 library included in the FH installation -- should we mark this one as compatible with FH7 (it will probably work, after all) or advise people to use lua 5.3 + utf8?
https://fhug.org.uk/kb/code-snippet/pla ... stitution/ Same query
If we do mark them FH7-compatible, somebody needs to review them to identify any changes or caveats needed.
I have some queries if anyone cares to take a look:
https://fhug.org.uk/kb/code-snippet/uni ... functions/ We have utf8 support in Lua 5.3 plus the utf8 library included in the FH installation -- should we mark this one as compatible with FH7 (it will probably work, after all) or advise people to use lua 5.3 + utf8?
https://fhug.org.uk/kb/code-snippet/pla ... stitution/ Same query
If we do mark them FH7-compatible, somebody needs to review them to identify any changes or caveats needed.
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Plugin code snippets in the KB
They are both essentially what my plugins use for FH v5, v6, v7 compatibility.
The only change in the UTF8 string functions is for function substring(strTxt,i,j) to cater for %z
For the general string functions, I have added a function inert(strTxt) to hide % symbols in gsub replacement strings where no captures are involved.
Clearly, it is not possible to use the Lua 5.3 + utf8 options if backward compatibility is required.
I have not yet investigated those options for plugins that only support FH v7.
The only change in the UTF8 string functions is for function substring(strTxt,i,j) to cater for %z
Code: Select all
local strUTF8 = "([%z\1-\127\194-\244][\128-\191]*)" -- Cater for Lua 5.1 %z or Lua 5.3 \0
if fhGetAppVersion() > 6 then
strUTF8 = "([\0-\127\194-\244][\128-\191]*)"
end
-- Supply character substring of UTF-8 text --
function substring(strTxt,i,j)
local strSub = ""
j = j or -1
if j < 0 then j = j + length(strTxt) + 1 end
if i < 0 then i = i + length(strTxt) + 1 end
for strChr in string.gmatch(strTxt or "",strUTF8) do
if j <= 0 then break end
j = j - 1
i = i - 1
if i <= 0 then strSub = strSub..strChr end
end
return strSub
end -- function substring
Code: Select all
-- Hide % escape/capture symbols in replacement so they are inert
function fh.inert(strTxt)
strTxt = tostring(strTxt or ""):gsub("%%","%%%%") -- Hide all % symbols
return strTxt
end -- function inert
I have not yet investigated those options for plugins that only support FH v7.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
-
shoshk
- Famous
- Posts: 242
- Joined: 13 May 2015 16:28
- Family Historian: V7
- Location: Mitzpe Jericho, Israel
Re: Plugin code snippets in the KB
Am I mistaken, but didn't there used to be a listing for the snippets according to category? Or am I making it up in my head because that's what I would like to see?
Shosh
Shosh
Shosh Kalson
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: Plugin code snippets in the KB
Not for snippets, not. They're pretty hard to categorize... but if you want to suggest a et of categories and which snippets belong where, that would be fine.
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Plugin code snippets in the KB
Code Snippets were always just listed alphabetically, but the other Downloads and Links were categorised as they are in the new KB.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
-
shoshk
- Famous
- Posts: 242
- Joined: 13 May 2015 16:28
- Family Historian: V7
- Location: Mitzpe Jericho, Israel
Re: Plugin code snippets in the KB
This is a quick and dirty first attempt to get a discussion going.
I created a pdf version, but it's apparently too big... So here's the Word version.
I created a pdf version, but it's apparently too big... So here's the Word version.
Shosh Kalson
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: Plugin code snippets in the KB
That breakdown looks fine to me, Shosh. I'll wait for others to comment, and when we have consensus, I'll set up the categories in the KB. I'd be grateful if somebody else would actually assign them -- I'm up to my neck at present.
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: Plugin code snippets in the KB
Thanks -- let's let Mike T and anyone else who's interested weigh in.
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Plugin code snippets in the KB
All the categories look good, although I suspect many of those in Other would fit elsewhere:
File & Folder
Load String from File
Load Text File to Table
Save String to File
Word Load Data Direct Into
Plugin / Lua / Programming
InList Is a value in a list
Strings
Format Number
User Interface
Result Set Creation
The remainder of the snippets under Other could go under Project Database Admin
Ancestor & Descendant List
Build Data Refs
Copy Child Branch Fields
Flags Add and Remove Function
Last Updated Date and Time
Relationship Codes
File & Folder
Load String from File
Load Text File to Table
Save String to File
Word Load Data Direct Into
Plugin / Lua / Programming
InList Is a value in a list
Strings
Format Number
User Interface
Result Set Creation
The remainder of the snippets under Other could go under Project Database Admin
Ancestor & Descendant List
Build Data Refs
Copy Child Branch Fields
Flags Add and Remove Function
Last Updated Date and Time
Relationship Codes
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: Plugin code snippets in the KB
Give me a while to remember how to set it all up...
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: Plugin code snippets in the KB
Shosh, you should be able to categorise them now -- let me know when you've done a few with different categories and I can check how they're displaying.
Thanks.
Thanks.
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
-
shoshk
- Famous
- Posts: 242
- Joined: 13 May 2015 16:28
- Family Historian: V7
- Location: Mitzpe Jericho, Israel
Re: Plugin code snippets in the KB
I don't see any snippet categories. I am trying both 'quick edit' and 'edit.'
Shosh Kalson
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: Plugin code snippets in the KB
I'm an idiot -- forgot to add all the categories. BRB...
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: Plugin code snippets in the KB
Try now. Don't forget you can put a plugin in two or more caregories if it makes sense to do so.
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
-
shoshk
- Famous
- Posts: 242
- Joined: 13 May 2015 16:28
- Family Historian: V7
- Location: Mitzpe Jericho, Israel
Re: Plugin code snippets in the KB
I can see the categories now, but can't assign them -- I get a 'forbidden' icon.
Tried it from both 'edit' and 'quick edit'
Tried it from both 'edit' and 'quick edit'
Shosh Kalson
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: Plugin code snippets in the KB
Try now -- my brain is running on very low blood pressure today!
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
-
shoshk
- Famous
- Posts: 242
- Joined: 13 May 2015 16:28
- Family Historian: V7
- Location: Mitzpe Jericho, Israel
Re: Plugin code snippets in the KB
I assigned categories to one page full of snippets.
One thing that I notice in the display (kb->downloads>snippets) is that snippets that have not been assigned to a category do not show up anywhere.
Shosh
One thing that I notice in the display (kb->downloads>snippets) is that snippets that have not been assigned to a category do not show up anywhere.
Shosh
Shosh Kalson
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: Plugin code snippets in the KB
It's expected the uncategorised snippets won't show up... I'll try to do a few myself.
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history
-
shoshk
- Famous
- Posts: 242
- Joined: 13 May 2015 16:28
- Family Historian: V7
- Location: Mitzpe Jericho, Israel
Re: Plugin code snippets in the KB
I don't have a problem to do the work, but it'll have to wait until tomorrow morning (it's almost 19:00 here).
Is there someway to verify that all snippets are categorized, short of going through them manually and checking?
Is there someway to verify that all snippets are categorized, short of going through them manually and checking?
Shosh Kalson
- ColeValleyGirl
- Megastar
- Posts: 4854
- Joined: 28 Dec 2005 22:02
- Family Historian: V7
- Location: Cirencester, Gloucestershire
- Contact:
Re: Plugin code snippets in the KB
I don't know of one, other than comparing counts... But let me know when you think you're finished and I'll try to double check.
Helen Wright
ColeValleyGirl's family history
ColeValleyGirl's family history