Git Product home page Git Product logo

Comments (6)

aranega avatar aranega commented on August 29, 2024

Hi @ipa-hsd,

Sorry for the late answer.

By generating documentation, do you mean generating comments/doc for each method/class/attribute in the generated code if some EAnnotations exist on the element, or do you refer to the generation of a kinf of textual representation of the metamodel for documentation purposes?

from pyecoregen.

hsd-dev avatar hsd-dev commented on August 29, 2024

I mean this

generation of a kinf of textual representation of the metamodel for documentation purposes?

For now I converted the ecore meta-model to json schema and used https://github.com/coveooss/json-schema-for-humans for generating html and md. But would be nice to generate the documentation directly from ecore, because some information is lost in a json schema.

from pyecoregen.

aranega avatar aranega commented on August 29, 2024

That's definitely true and a good point. The thing with pyecoregen is that it's tailored for Python code generation only. It doesn't mean that it's not possible to modify it to generate a documentation as you propose.

Basically, there is three approaches that could be use:

  • directly use pyecore to load the ecore metamodel and traverse it to print/generate the documentation,
  • use pymultigen (on which is based pyecoregen) to rewrite the different stage of a dedicated generator, but this approach seems to me more complicated as it implies a little bit of boilerplate code to have everything running,
  • use motra, which is still a little bit experimental, but is supposed to be more or less an equivalent of QVTo and Acceleo and let you generate code for any pyecore model/metamodel using mako syntax.

from pyecoregen.

hsd-dev avatar hsd-dev commented on August 29, 2024

Great! That was helpful. So sounds like you would prefer option 1. I will start experimenting with it, but might need your inputs from time to time. Maybe I will create an issue to track its progress.
Would it make sense to integrate it in pyecoregen as an option, something like --gen-doc?

from pyecoregen.

aranega avatar aranega commented on August 29, 2024

All depends on the complexity of what you want to generate. If the final code isn't so complicated, I would use motra as it will really be easy to prototype something. However, if the code starts to be really complicated, I would use the first solution.

That would be definitely really cool and valuable to have the documentation generation, but I wonder if it wouldn't make sense to directly have it in pyecore as pyecoregen is really here for the python code generation. Even if you use dynamic metamodels, I guess it could make sense to want to generate the documentation and it would feel a little bit weird to have to install pyecoregen to generate it if you don't want to generate the actual python code.

from pyecoregen.

hsd-dev avatar hsd-dev commented on August 29, 2024

I get your point and makes sense. Thanks for the discussion! I will close the issue for now.

from pyecoregen.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.