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

[📑 Docs]: Improve documentation related to File templates feature #1199

Closed
1 task done
derberg opened this issue Apr 24, 2024 · 10 comments · Fixed by #1230
Closed
1 task done

[📑 Docs]: Improve documentation related to File templates feature #1199

derberg opened this issue Apr 24, 2024 · 10 comments · Fixed by #1230
Assignees
Labels
bounty AsyncAPI Bounty program related label 📑 docs

Comments

@derberg
Copy link
Member

derberg commented Apr 24, 2024

What Dev Docs changes are you proposing?

we have at least comparizon from the perspective of "template for templates". So we see file templates in use in https://github.com/asyncapi/template-for-generator-templates/tree/nunjucks/template/schemas in times of nunjucks and then after conversion to react https://github.com/asyncapi/template-for-generator-templates/blob/master/template/schemas/schema.js

Code of Conduct

  • I agree to follow this project's Code of Conduct
@asyncapi-bot asyncapi-bot added the bounty AsyncAPI Bounty program related label label Jun 17, 2024
@aeworxet
Copy link

Bounty Issue's service comment

Text labels: bounty/2024-Q3, bounty/medium, bounty/docs
First assignment to third-party contributors: 2024-06-21 00:00:00 UTC+12:00
End Of Life after: 2024-07-31 23:59:59 UTC-12:00

@asyncapi/bounty_team

The Bounty Program is not a Mentorship Program. The accepted level of Bounty Program Participants is Middle/Senior.
Third-party contributors should coherently articulate how they are going to approach the resolution process when expressing a desire to work on this Bounty Issue.

@AayushSaini101
Copy link
Contributor

@aeworxet @derberg I would like to work on this issue, Past doc PR: https://github.com/asyncapi/generator/pull/1061/files https://github.com/asyncapi/community/pull/1155/files
Solution Step for the above issue:

  • Split the File template into two parts Nonjuck and React Engine.
  • Show different structure of component using React Engine.

To show List Channels of asyncapi document;

/* 
 * Here you can see example of complex operations. 
 * You can actually do whatever you want. It is important that the value returned from the function must be a string or a component.
 */
export function ListChannels({ channels, operationType = 'publish' }) {
  const namesList = Object.entries(channels)
    .map(([channelName, channel]) => {
      if (
        (operationType === 'publish' && channel.hasPublish()) || 
        (operationType === 'subscribe' && channel.hasSubscribe())
      ) {
        return  `<li><strong>${channelName}</strong></li>`;
      }
    })
    .filter(Boolean);

  return `
<h2>
  Channels that you can ${operationType} to
</h2>
<hr />
<br />
<div class="container mx-auto px-8">
  <ul class="list-disc">${namesList.join('')}</ul>
</div>
`;
}

To show info, server of asyncapi document:


const ReadmeTemplate = ({ asyncapi }) => {
  const { info, servers, } = asyncapi;

  return (
    <div>
      <h1>{info.title}</h1>
      <p>{info.description}</p>
      
      <h2>Servers</h2>
      <ul>
        {Object.entries(servers).map(([name, server]) => (
          <li key={name}>
            <strong>{name}</strong>: {server.url} ({server.protocol})
          </li>
        ))}
      </ul>


    </div>
  );
};

This would be structure to show rendering of different component in React Engine thanks

@aeworxet
Copy link

@AayushSaini101
You are already assigned to asyncapi/community#1268 and expected to work on asyncapi/cli#337 (@Amzani will assign you when he comes back from vacation,) so the limit or two simultaneous issues is reached.

@Florence-Njeri Florence-Njeri self-assigned this Jun 21, 2024
@derberg
Copy link
Member Author

derberg commented Jun 24, 2024

@Florence-Njeri as maintainer of docs in this repo will work on this issue

@aeworxet
Copy link

Bounty Issue's Timeline

Complexity Level Assignment Date (by GitHub) Start Date (by BP Rules) End Date (by BP Rules) Draft PR Submission Final PR Merge Start Final PR Merge End
Medium 2024-06-21 2024-07-01 2024-08-11 2024-07-14 2024-07-28 2024-08-11
Please note that the dates given represent deadlines, not specific dates, so if the goal is reached sooner, it's better.
Keep in mind the responsibility for violations of the Timeline.

@derberg
Copy link
Member Author

derberg commented Jul 15, 2024

@Florence-Njeri yo, so how is it going, you need help?

@aeworxet
Copy link

Review for PR #1230 was requested on 2024-08-06, and it is still in progress.

@aeworxet
Copy link

Response, critical for technical resolution of this Bounty Issue (review of the PR) was delayed for two periods of three consecutive working days
#1230 (comment)
#1230 (review)

so all remaining target dates of the Bounty Issue's Timeline are extended by three calendar weeks.

Bounty Issue's Timeline Extended

Complexity Level Assignment Date (by GitHub) Start Date (by BP Rules) End Date (by BP Rules) Draft PR Submission Final PR Merge Start Final PR Merge End
Medium 2024-06-21 2024-07-01 2024-09-01 2024-08-04 2024-08-18 2024-09-01
Please note that the dates given represent deadlines, not specific dates, so if the goal is reached sooner, it's better.
Keep in mind the responsibility for violations of the Timeline.

@derberg
Copy link
Member Author

derberg commented Sep 2, 2024

work completed with #1230

@aeworxet
Copy link

aeworxet commented Sep 2, 2024

Bounty Issue Is Completed 🎉

@Florence-Njeri, please go to the AsyncAPI page on Open Collective and submit an invoice for USD 200.00 with the expense title Bounty generator#1199, tag bounty, and full URL of this Bounty Issue in the description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty AsyncAPI Bounty program related label 📑 docs
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

5 participants