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

Choose columns to be displayed in properties table in md template #220

Conversation

paulovcmedeiros
Copy link

Hello developers!

Thanks for this package, I found it recently and it has been very useful for me. Since this is my first PR here, I do apologise in anticipation for eventual deviations from the expected format (although I have read the contributing guidelines). The changes here are described below.

  1. Add a config option properties_table_columns that can be used to choose the columns to be displayed in the properties tables, as well as the order in which they appear. For instance, one may write

    config = GenerationConfiguration(
        template_name="md",
        properties_table_columns=[
            "property",
            "type",
            "required",
            "default",
            "title/description",
        ],
    )

    And the output property tables will have columns

    | Property   | Type   | Required | Default | Title/Description  |

    The labels in the tables' headers are converted to title case.

  2. As part of the process, and due to some tests I'm running in another project which uses this to publish docs to a page on Githib pages, I noticed that some entries without a name were being included in the properties table. I changed the code so that these were no longer added.

  3. Another incidental change in this PR is to put anchor links on top of the headers. I found that having them insie the headers would cause duplication of the links in some cases (some templates use the headers to create menus, for instance), and then the links would no longer work as expected.

I am aware that this PR is failing the tests right now, because these changes produce results for the examples that are no longer identical to the expected ones. Would you be able to help me addressing these? I suspect you may already have some script to update the examples when doing changes that modify the expected outputs, so I thought it would be a good idea to ask first.

@paulovcmedeiros
Copy link
Author

Just realised a similar PR already exists, namely #185 , although there hasn't been much development on that lately.

@dblanchette
Copy link
Collaborator

Thanks for the contribution! I ended up merging the code from the other PR as it was more complete (see #224 )

Let me know if it does not solve your need

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

Successfully merging this pull request may close these issues.

2 participants