Skip to content

One-command article creation #8

@zakhenry

Description

@zakhenry

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions