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

DumpStyle.HTML Dump Option #39

Open
lawrencek76 opened this issue Jul 3, 2019 · 6 comments
Open

DumpStyle.HTML Dump Option #39

lawrencek76 opened this issue Jul 3, 2019 · 6 comments

Comments

@lawrencek76
Copy link

I was looking at adding another dump format for html. Is that something you would be interested in bringing into ObjectDumper?

I'm looking to create simple html output that would be useful in debugging web apps / web app error pages. html formatted diagnostic email messages.

@thomasgalliker
Copy link
Owner

Can you make an example of how such an html message would look like?

@lawrencek76
Copy link
Author

The primary output would be something like this for the example in the readme.

    <div class="obj-dump">
        <div class="obj-class-info">
            <span class="obj-label">Class Type:</span>
            <span
                class="obj-type-list-objectdumpersample-netfx-person">List&lt;ObjectDumperSample.Netfx.Person&gt;</span>
        </div>
        <table class="obj-type-list-objectdumpersample-netfx-person">
            <thead>
                <tr>
                    <th class="obj-type-string">Name</th>
                    <th class="obj-type-int">Age</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td class="obj-type-string">John</td>
                    <td class="obj-type-int">20</td>
                </tr>
                <tr>
                    <td class="obj-type-string">Thomas</td>
                    <td class="obj-type-int">30</td>
                </tr>
            <tbody>
        </table>
    </div>

Styling would be primarily left to the caller to add although it might be nice to have options for creating a full html document with some basic styling that generates something like this.

Capture

objDumperHtmlSample.txt

Of course there are lot of details to flesh out on this but I think that shows the general idea.

@thomasgalliker
Copy link
Owner

Yes why not integrating something like that. Kind of a report-style output. The thing is just: There will be people adking for different styles and formatting of the html output. Of course, we could build a highly flexible formatting logic but I think that would be a bit over the top, what do you think?

@lawrencek76
Copy link
Author

Yea simple at least at first. Adding classes so most styling can be done on the users end. Not trying to go crazy with options and flexibility.

@thomasgalliker
Copy link
Owner

I'm sorry for not coming back to this in time. I saw you're working on branch lawrence-Html. Is this still on? Does it already work?

@lawrencek76
Copy link
Author

lawrencek76 commented Aug 6, 2019

Yea still on, Just vacation is over, back to work. It is working in the simple case of object with properties and looking at how to deal with the more interesting case of collections of objects and making a html table out of it with nesting and all that.

The branch also has some refactor of the "core" logic into the base class, that will probably be split off and done as a separate pr.

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

2 participants