Closed bpetetot closed 7 years ago
New APIs :
GET /api/readme
: retrieve current README.md file content of the component (if exists)POST /api/readme
: create / save the README.md file of the component with given contentPOST /api/markdown
: generate the markdown from given component docgenThe goal of these APIs is to have the following process (in a next PR) :
documentation
GET /api/readme
POST /api/markdown
=> put generated markdown in a markdown editorsave
button will call POST /api/readme
and save / create the README.md fileI would like also to have buttons in the markdown editor to add some generated parts (in a next PR) :
Add description
: will add the description where the cursor is in the editorAdd props
: will add the component props documentation where the cursor is in the editorAdd screenshot
: will add a component screenshot where the cursor is in the editorTo 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
I asking myself about endpoints names. Why don't we use:
/api/file
(to replace /api/makrdown
), and make it more generic
POST /api/file/readme.md
by exampleGET /api/documentation
to generate the documentation,
GET /API/documentation?format=markdown|text|html
The endpoints don't have to be about format but about their purpose don't you think ?
Good idea !
We can also merge /api/file
with the current /api/fs
Examples :
GET /api/fs/foo/bar
will list folder /foo/bar
GET /api/fs/foo/bar/README.md
will get README.md file contentPOST /api/fs/foo/bar/README.md
will create / update README.md fileAnd I'm agree about being agnostic about the format with API documentation
Yeah I agree about merging both endpoints
@fabienjuif you can check it
60