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

[Feature] Playgrounds improvements #60

Closed
skoropadas opened this issue Jun 1, 2023 · 2 comments
Closed

[Feature] Playgrounds improvements #60

skoropadas opened this issue Jun 1, 2023 · 2 comments
Assignees
Labels

Comments

@skoropadas
Copy link
Member

skoropadas commented Jun 1, 2023

Description

I think it would be useful to add the following enhancements to playgrounds:

  • Directive support
  • Pipe support
  • Ability to input custom values for template variables

Proposed solution

What is meant by inputting custom values:
This is a kind of list of controls that can be manually created for use with a pipe. For example, a configuration may look as follows:

import {NgDocPage} from '@ng-doc/core';

const MyAwesomePage: NgDocPage = {
  playgrounds: {
    PipePlayground: {
      target: DatePipe,
      template: `{{ values.isoDate | datePipe }}`,
      values: {
        isoDate: 'string',
      }
    },
  },
};

export default MyAwesomePage;

NgDoc will create a control for the "isoDate" field based on the provided type. This will allow the user to input a value and see how it is processed by the pipe. Additionally, if the pipe has additional settings, NgDoc will display a list of them in the Settings section, similar to how it does for components.

For components and directives, this may not be as important since the values of their inputs change through controls in the Settings section, but this values can be used in the template (not for the inputs)

Alternatives considered

@skoropadas
Copy link
Member Author

I decided not to implement custom input controls, because the feature may be controversial and poorly used, but it can be added on a separate request if anyone needs it.

skoropadas pushed a commit that referenced this issue Jun 6, 2023
# [16.4.0](v16.3.6...v16.4.0) (2023-06-06)

### Features

* **builder:** builder and error/warning output have been improved, now the builder is more stable and it's easier to understand where you are haveing problems ([#61](#61)) ([7d11c79](7d11c79))
* **project:** add support for directives and pipes to playgrounds ([#62](#62)) ([28b0930](28b0930)), closes [#60](#60)
* **project:** now you can specify the anchors for the keywords that can create a link to the page's section or API member  ([#63](#63)) ([a16d5d4](a16d5d4)), closes [#2](#2)
@skoropadas
Copy link
Member Author

🎉 This issue has been resolved in version 16.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

1 participant