Automatic Grammar documentation
The Idea is to make a tool which will automatically generate documentation from Grammars. The way this will be done is by using the descriptions (rdescript and maybe an extra attribute which will be an extended description) in the mapping to create read me in markdown.
To make this work, We will need to standardize the way descriptions are written. The description Will need to contain the category In which it belongs as well as a short and concise description of the voice command's function.
1 example:
"stoosh": R(...,rdescript="text editing: copy selected text to caster clipboard")
This will produce a text editing section which will contain the command or add it to an existing section with this name. Every Grammar will also be different section with Subsections to avoid name collisions.
Alternatively every Grammar will produce a different read me and all will be joined Together to produce the final documentation.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
I think this would coincide very well with implementing https://github.com/synkarius/caster/issues/211 as it simplifies the documentation and requires re-factoring.
Automatic grammar documentation should take in account source code and filter rules.
Scratchpad - read the docs automation
Would it be viable to produce something similar to Dragon's Learning Centre? That is to say, have a window which lists the commands depending on which application is in focus? (Include global commands as well of course). I assume there is some way of running this process in the background without removing the focus from the desired application you want to work on? And have a global command similar to Dragon's "what can I say?"
@codingApprentice that would be an awesome feature. We used to have the status window which was very basic and was cut feature. I would like to see something implemented in kivy. Open up a the an issue as it's a distinctly different feature than automatically generating documentation. Expand on what you'd like to see in a GUI.
How we generate documentation should be considered when implementing if we want implemented GUI.
I like the Idea. I Could export a json with the data tο be used in such a program
Right now the settings window utilizes a SimpleXMLRPCServer. I'm hoping to convert that to grpc. I'm switching from rest to grpc for the API.
Any progress on this? A simple tkinter dialog window via named pipe did not work for me, looking into Caster code there is SimpleXMLRPCServer, but I can wait for grpc if it is the preferred way. Or even help with porting existing and creating documentation windows, if you are not in a hurry.
I haven't had as much time returning to work and planning a wedding. One of the major reasons to switch to grpc as it allows easier integration into other programs that utilize a different programming language.
The conversion to grpc isn't necessary to begin work on automatic documentation. The starting point would be the redesign of registered actions with additional properties #235. .4 adding addresses categories as metadata. Short-term goal is to be able to generate a new PFD document automatically. Long-term goal is to integrate documentation directly into castor that's contextually aware. Similar to the what can I say command for DNS.
@comodoro besides documentation what would you implement using dialog windows?
Just playing. 1. A general query answer window, where the queries are programmable and assignable to voice commands. 2. Conversation with a chatbot.
@gerrish Some progress for exposing grammars for documentation. https://github.com/Danesprite/dragonfly/commit/f366b07bfb1aea770c66c6141d0d502cea4068a5
EngineBase.grammars has been added as property. We should be able to get the engine object using grammar.engine or importing and calling dragonfly.get_engine()
@comodoro we are working towards a GUI framework in dragonfly. https://github.com/Danesprite/dragonfly/issues/24 As it stands in the moment the proposed libraries to drive GUI framework will consist of two parts Tkinter and grpc. At the moment were working on integrating grpc into dragonfly.
I made a couple of somewhat hacky scripts in order to generate markdown table docs for the IDE and language commands, which can be found here: https://github.com/mrob95/caster/blob/doc_update/generator.py https://github.com/mrob95/caster/blob/doc_update/generator_apps.py
It's fairly easy to pull the command names from the keys of the mapping dictionary, but I don't have an easy way of rendering the output of the command as a string (although there may well be one, I'm not very familiar with dragonfly). For now I entered them manually but this makes updating the docs a pain whenever new language commands are added.
sphinx or pdoc3 for python will autogenerate documentation
There's a bit of an update on this in the dragonfly repository to which I posted additional information, https://github.com/dictation-toolbox/dragonfly/issues/259