Zenika / react-workbench

Design your React component in an isolated context
MIT License
8 stars 1 forks source link

:sparkles: markdown and readme api #91

Closed bpetetot closed 7 years ago

bpetetot commented 7 years ago

60

bpetetot commented 7 years ago

New APIs :

The goal of these APIs is to have the following process (in a next PR) :

  1. The user will click on a button documentation
  2. It calls GET /api/readme
    • if README.md already exists => display existing markdown in a markdown editor
    • else call POST /api/markdown => put generated markdown in a markdown editor
  3. The user can update the component documentation through the editor
    • a save button will call POST /api/readme and save / create the README.md file

I would like also to have buttons in the markdown editor to add some generated parts (in a next PR) :

To make the Add description and Add props buttons, I will need to improve API POST /api/markdown adding some query parameters : POST /api/markdown?q=props

fabienjuif commented 7 years ago

I asking myself about endpoints names. Why don't we use:

The endpoints don't have to be about format but about their purpose don't you think ?

bpetetot commented 7 years ago

Good idea ! We can also merge /api/file with the current /api/fs Examples :

And I'm agree about being agnostic about the format with API documentation

fabienjuif commented 7 years ago

Yeah I agree about merging both endpoints

bpetetot commented 7 years ago

@fabienjuif you can check it