~aoirthoir

USA

http://aoirthoir.com

I am a Truck Driver.

Recent activity

Re: How to Access nav_path? 4 months ago

From Aoirthoir An Broc to ~dmbaturin/soupault

Alright I figured out what I was doing wrong here...

With nav_path it isnt until you get a couple layers deep before it even 
appears.. so the array is basically empty until then... here is how i 
tested.. a little cheating plugin that I now run on a test site with 
nothing else to see if i get values from my prototype plugins

results = '\nPAGE FILE: '..page_file..
           '\n   PLUGIN: '..config.widget..
           '\n  MESSAGE: '..config.message..'\n           '

local key, value = next(nav_path,nil)
while key do
   results    = results..'nav.'..key..' = "'..value..'"'

Can we access the values in [settings] and [widgets.whatever]? 4 months ago

From Aoirthoir An Broc to ~dmbaturin/soupault

Can we access the values in [settings] and [widgets.whatever]?

So I mean two things...

[widgets.newSection]
   widget = 'insertHTML'
   html    = '<hr>'
etc...
we can access config.widget and config.html and get those values. But I 
am interested in accessing the value newSection. Is that possible right now?

Next for settings:

[settings]

addClass.lua naming vs add-class.lua 4 months ago

From Aoirthoir An Broc to ~dmbaturin/soupault

will the following create any operating system issues, such as with windows:

addClass.lua being called with widget="addClass"

vs

add-class.kua being called with widget="add-class"

ADD1.error_message() function 4 months ago

From Aoirthoir An Broc to ~dmbaturin/soupault

Just created ADD1.error_message() function which can also be called with 
err() as follows:

Log.warning(err('include-tag.lua',success..' filepath:'..filepath))

err(plugin_name,message) or ADD1.error_message(plugin_name,message)

Here is the code to create both functions:

-- *********************************************************************
-- * ADD1.error_message()
-- *********************************************************************
   function ADD1.error_message(plugin,message)
     local results

Re: Incompatible changes for the 2.0 release 4 months ago

From Aoirthoir An Broc to ~dmbaturin/soupault

So right now I am running this error message code:

success, data = ADD1.get_file(filepath)
if success == 'SUCCESS' then
   ADD1.process_element('replace_element', element, data, raw)
else
   Log.warning(
     ' page_file:'..page_file..
     ' plugin:include-tag.lua'..
     ' error:'..success..
     ' filepath:'..filepath)
end

Giving me this result:

Re: Incompatible changes for the 2.0 release 4 months ago

From Aoirthoir An Broc to ~dmbaturin/soupault

Log.warning()
Log.info()
Plugin.fail()
Plugin.exit()
Plugin.require_version()

automatically include page_file and plugin_file.. so we know where it 
was called from...

Let me know if these ideas are cumbersome since I am posting so many. 
Any you want you can discard of course...

Re: Incompatible changes for the 2.0 release 4 months ago

From Aoirthoir An Broc to ~dmbaturin/soupault

I decided to go through your plugins so i could see how you were 
handling things... for instance i thought you had a plugin to convert to 
html_entities but when i wa writing all that code these past couple 
weeks i could not remember what it was. i thought it was a built in 
widget. in any case i wrote my own with my library so i wanna share and 
compare and explain in case you wanna use these kind of ideas in the main...

This is your code from escape-html.lua:

========================
selector = config["selector"]
if not selector then
   Plugin.fail("Missing required option \"selector\"")
end

Re: Incompatible changes for the 2.0 release 4 months ago

From Aoirthoir An Broc to ~dmbaturin/soupault

I agree here are my thoughts section by section...

==========
[index.custom_fields]
   foo = { selector = "#foo", extract_attribute = "bar"}
==========

Allow custom fields to include things besides/selectors attributes only 
such as:

inner_html
filename
luacode return value or luacode function return value (see my 
do-code.lua plugin).

Re: Neighboring Elements HTML.functions returns error 4 months ago

From Aoirthoir An Broc to ~dmbaturin/soupault

Excellent thank you.

I am not sure the use cases for the others. I suspect that I will almost 
entirely be working with element nodes myself. Browser side I understand 
the need for such nodes in javascript but soupault side, I cannot think 
yet. If it comes to it, we can figure it out then. otherwise 
HTML.inner_html will be what we need most times anyhow. I'll upgrade as 
soon as the new release is out and retest.

Re: Neighboring Elements HTML.functions returns error 4 months ago

From Aoirthoir An Broc to ~dmbaturin/soupault

That all sounds reasonable. Especially since much of the time we are 
going to just work on elements anyhow...

Maybe in addition to HTML.is_element, there could be HTML.is_document, 
HTML.is_text and so on... also HTML.node_type...