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

Enhancement: Ability to prompt from the a custom script #888

Open
estruyf opened this issue Nov 13, 2024 · 0 comments
Open

Enhancement: Ability to prompt from the a custom script #888

estruyf opened this issue Nov 13, 2024 · 0 comments
Labels
enhancement New feature or request To document This item needs to be documented v10.7.0 Project: v10.7.0

Comments

@estruyf
Copy link
Owner

estruyf commented Nov 13, 2024

You can already ask questions via the extensibility model (https://www.npmjs.com/package/@frontmatter/extensibility), but it would be helpful to prompt GitHub Copilot.

Example usage:

import { ContentScript } from "@frontmatter/extensibility";

const contentScriptArgs = ContentScript.getArguments();
if (contentScriptArgs) {
  const {
    frontMatter: { title, description, slug },
    promptResponse
} = contentScriptArgs;

if (!promptResponse) {
  ContentScript.promptCopilot(`Create me a good post for sharing this on the BlueSky social media platform. To generate the post, please use the following information:

Title: """${title}"""
Description: """${description}"""

The output should be plain text and should not include any markdown or HTML tags. You are free to add hashtags.

IMPORTANT: Please make sure to keep the post under 265 characters.`);
  return;
}

// Do the rest
@estruyf estruyf added the enhancement New feature or request label Nov 13, 2024
@estruyf estruyf moved this to In progress in v10.7.0 Nov 13, 2024
@estruyf estruyf added this to v10.7.0 Nov 13, 2024
@project-labels project-labels bot added v10.7.0 Project: v10.7.0 In progress This is actively being worked on labels Nov 13, 2024
@project-labels project-labels bot added To document This item needs to be documented and removed In progress This is actively being worked on labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request To document This item needs to be documented v10.7.0 Project: v10.7.0
Projects
None yet
Development

No branches or pull requests

1 participant