Giter VIP home page Giter VIP logo

Comments (8)

jessevdk avatar jessevdk commented on July 23, 2024

Hello, thanks for the report! I understand you can't just put up the code your working on but you're right that it would be a bit easier if you had some minimal example exposing the various issues. In any case, the initial focus has been a bit more on the C++ side, so some bugs for documenting C were to be expected. I think the first two issues will be not too difficult to solve, probably some minor bugs and I hope I can fix them quite soon. With regard to your third point, it's indeed the case that functions which receive as a first argument a pointer to a struct are moved automatically to a separate page for that struct. This happens as soon as there is at least one function for such a struct. Right now there isn't any setting or directive to change that. The fourth item is basically a feature that I want to implement, but it's not a very high priority (there are some more pressing, actual bugs, that should be fixed first).

Just to give you my point of view, I want cldoc to be a consistent, clear and easy to use documentation tool across different projects. In that mindset I don't plan to implement too many customizations on the generated output, at least not at first. The structure of the documentation should be the same everywhere, mostly. That said, of course the current behavior is not yet the ideal default, so I'm more than happy to get suggestions on improvements. I'll think a bit more about the third bullet point (I'm not completely satisfied myself with the "more information on separate page" items).

from cldoc.

 avatar commented on July 23, 2024

Hi Jesse,

I've noticed an issue with creating C documentation as well. Looks like right now the functions are only getting categorized in one of the types associated with the function instead of all (return type, parameters). This would be incorrect behaviour right? If this is actually a bug and not just me misusing cldoc I may be able to pitch in and help fix it.

I need a good document generator for C code, like clang, and can't stand using doxygen.

from cldoc.

jessevdk avatar jessevdk commented on July 23, 2024

C functions are currently automatically moved to the page of the struct which is the first argument of the function (if there are more than N such functions). The idea is that often C API's are made like such:

struct _SomeType;
typedef struct _SomeType SomeType;

const char *some_type_get_name (SomeType *s);
void some_type_set_name (SomeType *s, const char *name);

/* etc */

i.e. the struct type represents a kind of object with API functions. Making this behavior the default is arguable, especially since not all C API works this way.

What you have in mind is something else, more like a "show me all functions that use this type as part of their signature". That's not what cldoc does right now. It's an interesting feature by itself, but something that I would expose as a kind of query I think.

from cldoc.

 avatar commented on July 23, 2024

Ok, that makes sense and what I was expecting. What I am observing right now though is...

typedef int err_t;

typedef struct _bar_t bar_t;

err_t foo(bar_t *bar);

Where all functions are going to the return type err_t. Is that expected behaviour?

from cldoc.

jessevdk avatar jessevdk commented on July 23, 2024

No, that looks like a bug. Could you maybe open a separate issue for this?

from cldoc.

 avatar commented on July 23, 2024

Will do.

from cldoc.

avikde avatar avikde commented on July 23, 2024

[SOLVED]

Hi, I am also trying to document some C code with cldoc. I'd like the functions to be categorized in the categories I specify, but it seems like the policy of grouping under the first argument struct (your comment on Dec 10, 2013) seems to override my specified category. What part of the source code should I go to to change this priority? Should I be looking in tree.py?

EDIT: Replacing line 332 in tree.py by parent = None did what I wanted.

from cldoc.

jounathaen avatar jounathaen commented on July 23, 2024

Hello, old issue but: Is there a workaround? Sorting the functions with a struct as first parameter to the struct does make no sense in my code...

from cldoc.

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.