Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation in wiki #15

Open
jfalcou opened this issue Jun 9, 2015 · 22 comments
Open

Documentation in wiki #15

jfalcou opened this issue Jun 9, 2015 · 22 comments

Comments

@jfalcou
Copy link
Collaborator

jfalcou commented Jun 9, 2015

No description provided.

@jfalcou jfalcou added this to the Version 1.1 milestone Sep 25, 2015
@jfalcou jfalcou modified the milestones: Version 1.1, Version 1.2 Dec 6, 2015
@odinthenerd
Copy link
Contributor

I guess this is a good place to ask for documentation ;)

if I have a metafunction lets say:

template<typename T, typename U>
struct MyData{};

template<typename T>
struct GetU;
template<typename T, typename U>
struct GetU<MyData<T,U>> {
    using type = U;
}

and I want to pass it to transform as a lambda what do I need to wrap it with in order to pass it as a lambda?

using l = list<MyData<int,int>,MyData<char,bool>>;
using restult = transform<l,WhatWrapperDoIUse<GetU>>;

Surely there is a wrapper class like:

template<template<typename...> class T>
struct Template{
    template<typename... Ts>
    using apply = T<Ts...>;
};

but I can't seem to find it.

@jfalcou
Copy link
Collaborator Author

jfalcou commented Dec 22, 2015

passing GetU<_1> should be enough as in MPL.

@odinthenerd
Copy link
Contributor

Thanks for the answer, that works well, brigand::quote also does what I wanted.

@edouarda edouarda modified the milestones: Version 1.3, Version 1.2 Mar 14, 2016
@jfalcou
Copy link
Collaborator Author

jfalcou commented Mar 19, 2016

@ccharly, don't forget to make th python thingy for this issue ;)

@edouarda
Copy link
Owner

I started the layout and wrote the first tutorial. I think the best is to do a little every day rather than everything in one pass. We should discuss how to describe the functions because a lot can be scripted I think.

@jfalcou
Copy link
Collaborator Author

jfalcou commented Jul 23, 2016

I guess @ccharly script was used ?

As for the function, I think we should have a standardese like wording.

@edouarda
Copy link
Owner

edouarda commented Jul 24, 2016

I used his script but had to do a pass after there is a bug that writes \ instead of / in the path.

I'm not sure I understand your comment about the functions? My question was about, how much can we generate by a script and avoid the mistake of typing by hand? We could use doxygen but I submit it might suffer with the TMP heavy code.

@edouarda
Copy link
Owner

Do you guys have any ideas for tutorials?

@edouarda
Copy link
Owner

We could also use github pages.

@nilsdeppe
Copy link
Contributor

I'd like to start adding documentation as I use brigand, partly just to remind myself how to use things in the future and partly because that's probably not a bad way to go about doing it. Has there been any further thought on how to implement documentation? Newer doxygen handles template parameters, as well as template-template parameters and variadic templates. Some decision on how to document the corresponding lazy evaluations would need to be made too. Maybe these should be described in the non-lazy documentation as well? Louis Dionne is using Doxygen with Boost.hana and it seems to work out, we could ask to get some feedback from him. Thoughts?

@ldionne
Copy link

ldionne commented Jan 10, 2017

FWIW, I hate Doxygen with all my heart but I was not aware of a better solution at the time of writing Hana's documentation. It's full of quirks and I can't really recommend it for documenting template-heavy libraries. If you do end up using Doxygen, you should however consider taking inspiration from what I've done. I've spent (lost?) many many hours trying to get something decent out of Doxygen, so hopefully this can be useful to you too.

@brunocodutra
Copy link

brunocodutra commented Jan 10, 2017 via email

@edouarda
Copy link
Owner

In quasardb we use Doxygen to describe ou C-API and that's a use case where it works nicely. For TMP honestly I think it may be easier and quicker to write a Python script. I'm open to suggestions.

@mkurdej
Copy link
Contributor

mkurdej commented Jan 10, 2017

I may just suggest trying out standardese (https://github.com/foonathan/standardese). It's more or less Doxygen-like, but thought throughout for modern C++ (including TMP). I've tried it on toy projects only, nothing of real-world size, but it seems like a nice way to explore.

@odinthenerd
Copy link
Contributor

I'm all for @foonathan 's standardese!

@foonathan
Copy link

I've put the output standardese currently generates on my website.
You can browse it by file: http://foonathan.net/doc/brigand/standardese_files.html
Or by entity: http://foonathan.net/doc/brigand/standardese_entities.html
As there are no documentation comments it just generates a synopsis of the file.
I

The option to generate the documentation were: standardese -I/tmp/brigand /tmp/brigand/brigand/ --input.blacklist_namespace=detail --compilation.comments_in_macro=false --output.format=html
The compilation option was needed because of some Boost.MPL stuff, would be an error otherwise.
When you play with it yourself, please build the develop branch as I had to fix a couple of issues there.

@edouarda
Copy link
Owner

Roger that, thanks!

@odinthenerd
Copy link
Contributor

thanks @foonathan!

Just noticed in the case of std::integral_constant<std::size_t, sizeof...(T)> you are linking to a search for std::integral_constant<std::size_t, sizeof...(T)> which finds nothing, searching for std::integral_constant would probably yield better results (minor low priority feature request ;)

@foonathan
Copy link

I've fixed that on develop.

If there is anything else I can improve or if you need help with anything, let me know.

@nilsdeppe
Copy link
Contributor

@foonathan this is great! Thanks for helping out so quickly.

I'll start adding documentation as I work with brigand. Deciding on how to document everything might be best done once we see what things look like and have done some experimentation.

@foonathan
Copy link

I've updated the generated documentation with the latest develop build as well as enabled the option --output.require_comment_for_full_synopsis=false. It forces the full synopsis of class types in the file synopsis as welll; it was just to show how each synopsis will look before the documentation is written.

@edouarda
Copy link
Owner

That's pretty awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants