Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Abandoned Plugin] MarlinGcodeDocumentation #1347

Open
gudvinr opened this issue Feb 1, 2025 · 9 comments
Open

[Abandoned Plugin] MarlinGcodeDocumentation #1347

gudvinr opened this issue Feb 1, 2025 · 9 comments

Comments

@gudvinr
Copy link

gudvinr commented Feb 1, 2025

Which Plugin?

https://plugins.octoprint.org/plugins/marlingcodedocumentation/

Link to ticket on plugin's issue tracker confirming abandonment

costas-basdekis/MarlinGcodeDocumentation#25

Is there someone open to adopting it?

No response

@jneilliii
Copy link
Contributor

I'll give the plugin author one more week to respond to the issue posted on their repo, but yes looks to be abandoned.

jneilliii added a commit to jneilliii/plugins.octoprint.org that referenced this issue Feb 8, 2025
@thomasnemer
Copy link

Hi @jneilliii 👋

I don't know what it takes to maintain an Octoprint plugin, but I find this one very useful, so I'll read some docs and maybe I'll raise my hand to take over as maintainer :)

@dietervdwes
Copy link

I must say I personally also find this plugin super useful. Wouldn't mind helping maintaining.

@gudvinr
Copy link
Author

gudvinr commented Feb 9, 2025

It seems that plugin generates machine-readable docs here

So basically you need to fork their repos and set up documentation generator via github actions or something else that periodically updates data.

There could be issues caused by marlin changing documentation format so this must be fixed too.

@jneilliii
Copy link
Contributor

yeah, looking at the plugin code, it seems to already have a documentation update mechanism and with settings to pull from https://raw.githubusercontent.com/costas-basdekis/gcode-documentation-parser/output/output/all_codes.json, which hasn't been updated in 2 years. They do seem to have an action workflow to automate this, but I suspect either a secret key expired or something and it's no longer running on a regular basis. Like you said, it would technically just be a forking of that plugin and re-point the plugin's setting to the forked output json file.

@thomasnemer
Copy link

I've forked the gcode-documentation-parser repo here, and refreshed it a bit :

  • switch from poetry to uv
  • use mise
  • rewrote workflows

The generated documentation seems coherent to me.

@thomasnemer
Copy link

Works pretty well actually, I fed the plugin with my fork's output, here's what it gives for a command that's part of the last commit of my output branch :

Image

@jneilliii
Copy link
Contributor

jneilliii commented Feb 13, 2025

Was going to test out your export, but I can't seem to get the plugin to load at all with default settings with the following error in browser's developer tools.

Image

Issue was related to not having the js bundled I think. Once I removed the following from my config.yaml it loads fine.

devel:
  webassets:
    bundle: false
    minify: false

plugin doesn't like windows instances at all, when attempting to update it gives errors. if someone does adopt this plugin it might be something to add to the list of issues.

2025-02-12 23:23:38,026 - octoprint.plugins.marlingcodedocumentation - INFO - Updating GCode documentation...
2025-02-12 23:23:38,026 - octoprint.plugins.marlingcodedocumentation - INFO -  * Fetching https://raw.githubusercontent.com/thomasnemer/gcode-documentation-parser/refs/heads/output/output/all_codes.json
2025-02-12 23:23:38,209 - octoprint.plugins.marlingcodedocumentation - INFO -  * Saving update (843932 bytes) temporarily to C:\OctoPrint-Windows\basedir\5000\data\marlingcodedocumentation\new-all_codes.json before renaming to C:\OctoPrint-Windows\basedir\5000\data\marlingcodedocumentation\all_codes.json
2025-02-12 23:23:38,220 - octoprint.server.api - ERROR - Error while executing SimpleApiPlugin marlingcodedocumentation
Traceback (most recent call last):
  File "C:\OctoPrint-Windows\WPy64-31050\python-3.10.5.amd64\lib\site-packages\octoprint\server\api\__init__.py", line 161, in pluginCommand
    response = api_plugin.on_api_command(command, data)
  File "C:\OctoPrint-Windows\WPy64-31050\python-3.10.5.amd64\lib\site-packages\octoprint\util\__init__.py", line 1686, in wrapper
    return f(*args, **kwargs)
  File "C:\OctoPrint-Windows\WPy64-31050\python-3.10.5.amd64\lib\site-packages\octoprint_marlingcodedocumentation\__init__.py", line 163, in on_api_command
    self.update_documentation()
  File "C:\OctoPrint-Windows\WPy64-31050\python-3.10.5.amd64\lib\site-packages\octoprint_marlingcodedocumentation\__init__.py", line 140, in update_documentation
    new_all_codes_path.rename(self.documentation_path)
  File "C:\OctoPrint-Windows\WPy64-31050\python-3.10.5.amd64\lib\pathlib.py", line 1234, in rename
    self._accessor.rename(self, target)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\OctoPrint-Windows\\basedir\\5000\\data\\marlingcodedocumentation\\new-all_codes.json' -> 'C:\\OctoPrint-Windows\\basedir\\5000\\data\\marlingcodedocumentation\\all_codes.json'

I'd also switch this bit of js

            self.onUpdateDocumentation = async function () {
              var response = await fetch("/api/plugin/marlingcodedocumentation", {
                method: "POST",
                headers: {
                  "Content-Type": "application/json",
                  "X-Api-Key": self.settingsViewModel.api_key()
                },
                body: JSON.stringify({
                  command: "update-documentation"
                })
              });
        
              if (!response.ok) {
                return;
              }
        
              var newData = await response.json();
        
              if (!newData) {
                return;
              }
        
              self.documentationService.update(newData);
            };

with

            self.onUpdateDocumentation = function () {
                    OctoPrint.simpleApiCommand("marlingcodedocumentation", "update-documentation", {}})
                        .done(function (data) {
                            if (!data) {
                                return;
                            }
                            self.documentationService.update(data);
                        });
            };

to avoid 403 forbidden errors.

@thomasnemer
Copy link

I didn't have a look at the plugin itself yet, only the gcode parser. I intended do dig into it asap. I'm not very comfortable with javascript and frontend stuff in general, but that might be a good opportunity to improve myself. I'll do the same as for the gcode parser, fork the repo, and spend some time playing with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

4 participants