| ▲ | sampsonj 2 days ago | |
Please post here once you have something working, or what you find if you struggle. I would be interested to see if you could get something working and would love to be wrong, as it would be nice to have something similar that does not use an LLM. It would be really cool if something more useful comes out of my experiment. I don't think you could reuse much from my codebase, but feel free to take anything from it that you want. Some things that might be useful to know to speed you up: 1. Most code blocks on the internet are easy to find in a webpage. They generally are surrounded by `<code/>` tags. You can query for these using the method in my extension. Then you will need to filter out any code block that has a `<span/>` count <= 1, as code blocks are used to highlight arbitrary stuff on the internet and you would really just want to find the blocks of code. 2. You will need a method to identify when to generate documentation for a code block even with your implementation, as some documentation websites are one really long page. You can do this with two types of observers that I use in my codebase. One will identify when a code block is in view and the other will keep track of mutations to code blocks. You need to keep track of mutations because sites like ChatGPT continuously edit a code block while streaming a response. You want to generate documentation once it's done, as that's when the code is well formed. I have a janky example of how to do this in my extension. Claude should be able to find the code. 3. LLMs were useful for building this, but they struggled with design decisions, especially around UX. This project seems out of distribution for them. Claude probably won't suggest the right solution a lot of the time, but if you have it list out multiple options, it can usually identify which one is best. I will probably check back here in a couple weeks if I don't hear anything from you. I would be really impressed if you can get something working in a weekend that is *not just hard coded for a specific use case, but scales well.* | ||