Skip to content

Lua section of manual has bad code examples #16622

@pozix604

Description

@pozix604

Describe the bug

Scripting with Lua section has code samples that do not work.

Steps to reproduce

See code sample at https://docs.darktable.org/usermanual/4.6/en/lua/simple-shortcut/.

Expected behavior

Code samples should work

Logfile | Screenshot | Screencast

No response

Commit

No response

Where did you obtain darktable from?

OBS

darktable version

4.6.1

What OS are you using?

Linux

What is the version of your OS?

Debian 12

Describe your system?

Samples do not work. For example, manual has:

darktable = require "darktable"

local function hello_shortcut(event, shortcut)
darktable.print("Hello, I just received '"..event..
       "' with parameter '"..shortcut.."'")
end

darktable.register_event("shortcut",hello_shortcut, "A shortcut that prints its parameters")

Last line should be:

darktable.register_event("hello_short", "shortcut",hello_shortcut, "A shortcut that prints its parameters")

There may be other ones.

Are you using OpenCL GPU in darktable?

None

If yes, what is the GPU card and driver?

No response

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions