Git Product home page Git Product logo

Comments (9)

czyzby avatar czyzby commented on May 10, 2024

Huh, I was pretty sure it works and comments are allowed anywhere.

I think comments are necessary - they are the only link between DTD files and Java code. If you want to see the full documentation about a certain attribute or tag, you can CTRL click it in most IDEs, check out the name of the Java class in its comment and then go through LML sources.

I can, however, make it optional to generate comments.

from gdx-lml.

czyzby avatar czyzby commented on May 10, 2024

Use Dtd#saveSchema(LmlParser, Appendable) if you want to generate DTD with comments; use Dtd#saveMinifiedSchema(LmlParser, Appendable) instead.

This fix will be included in 1.6 version. Use 1.6.1.9.2-SNAPSHOT for now.

from gdx-lml.

jpsgamboa avatar jpsgamboa commented on May 10, 2024

If I understood correctly, you altered the 1.6.1.9.2-SNAPSHOT to use this format:

<!-- CellSizeLmlAttribute -->
<!ATTLIST visslider size CDATA #IMPLIED>
<!-- TreeNodeLmlAttribute -->
<!ATTLIST visslider node CDATA #IMPLIED>

Because that's how my DTD got generated now.
Intellij froze for a bit after generating the file (perhaps because it's massive - it loads all the attributes and tags instantly, though!), but the result is this thing of beauty:

lmlattlist

No more red spots!

I'd suggest leaving this as an option in 1.6, since we get to keep the comments.

Finally, thanks for how quickly you sorted this. It makes LML much much friendlier to use!

from gdx-lml.

czyzby avatar czyzby commented on May 10, 2024

Yes, I implemented it as you suggested and this is the default generation mode right now. I tested the generated DTD files (both with and without comments) with an external DTD validator and they seem to be correct.

from gdx-lml.

czyzby avatar czyzby commented on May 10, 2024

(By the way - you seem to have only 1 root actor in this template: table. In this case you don't need :noop root. :noop is a utility when you need to create a list of actors that should be added directly to stage with a single template - for example, a Table as background and a Window for actual GUI. Your template could look like this:

<?xml ...?>
<!DOCTYPE table SYSTEM "lml.dtd">

<table fillparent="true" align="top>
    ...
</table>

Not that your approach is wrong or anything, but keep in mind that you don't have to flood every template with :noop, especially since every macro parsing has some [small] overhead.)

from gdx-lml.

jpsgamboa avatar jpsgamboa commented on May 10, 2024

Thanks for the tip! I actually added the file header and the <:noop> root tag to the file template in IntelliJ because I'm lazy, but I suppose most of my templates will end up having a relevant root element anyway so I'll change that!

from gdx-lml.

czyzby avatar czyzby commented on May 10, 2024

BTW, have you tried looking into my other extensions? I really appreciate the input of users other than myself, as I'm clearly biased and focused on the features that _I_ needed, which makes it harder to find bugs or lousy documentation. For example, I never needed DTD (having implemented gdx-lml, I pretty much memorized most of Scene2D API), and now it turns out it had some issues.

It would be great if you had a look at gdx-autumn (dependency injection with component scanning) and gdx-autumn-mvc (model-view-controller semi-framework on top of LibGDX) - you can start with this and this example. I think it makes it much easier to build applications, and the slightly longer initial loading time due to reflection use is a small price to pay.

But, obviously, I'll say things like that, as I'm the author. Oh, well.

from gdx-lml.

jpsgamboa avatar jpsgamboa commented on May 10, 2024

I looked into autumn-mvc but decided against using it in my current project for fear of getting stuck at some point (I'm not too experienced and abstracting too much functionality makes it harder to get over some walls).

But since you seem to be actively maintaining this extensions (and willing to help) I will definitely look into it soon.

Right now I'm working on a desktop application and intend on using LML actively (it's truly awesome, thank you for this), so you can count on my input on it in the near future!

from gdx-lml.

czyzby avatar czyzby commented on May 10, 2024

Fair enough. Well, thanks for you help with LML. If you have any problems (with gdx-lml or any other library) don't hesitate to create issues.

from gdx-lml.

Related Issues (20)

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.