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

One-command article creation #8

Open
zakhenry opened this issue Jul 13, 2019 · 1 comment
Open

One-command article creation #8

zakhenry opened this issue Jul 13, 2019 · 1 comment

Comments

@zakhenry
Copy link
Collaborator

Thinking about how to extend dev-to-git so that it can automatically create an article without the manual step of going to dev.to

proposed command

dev-to-git create-article "My amazing new blog post"

I've raised #7 to better help with the creation of more complicated CLI commands

basically the way I see this working is

  1. command creates a new markdown file without saving it to disk
    • Frontmatter is initialized with the title and empty values for all other fields
  2. dev.to POST api is invoked creating this new article
  3. response is analysed and the article ID is inserted into the frontmatter of the in-memory markdown article
  4. On success of all above steps, the article is written to disk
  5. If there is a .dev-to-git.json config file present (I'm planning on making this optional), the newly created article is appended.

By inserting the id into the frontmatter, this gives us the ability to update the article by simply reading the markdown file to be published.

@daKmoR
Copy link

daKmoR commented Aug 27, 2020

sounds like a good idea 👍

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

No branches or pull requests

2 participants