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

add basic API endpoint for rendering markdown #197

Merged
merged 5 commits into from Jan 3, 2020
Merged

add basic API endpoint for rendering markdown #197

merged 5 commits into from Jan 3, 2020

Conversation

@robjloranger
Copy link
Member

robjloranger commented Oct 15, 2019

This adds a new POST endpoint /api/generate/markdownify which takes a JSON body:

{"raw_body": "raw markdown goes here"}

and a header Content-Type: application/json which will return a JSON response containing the html version.

{"body": "html lies here"}

  • I have signed the CLA
@robjloranger

This comment has been minimized.

Copy link
Member Author

robjloranger commented Oct 15, 2019

exact endpoint to be discussed

@thebaer thebaer added this to the 0.12 milestone Nov 11, 2019
postrender.go Outdated Show resolved Hide resolved
postrender.go Outdated Show resolved Hide resolved
postrender.go Outdated Show resolved Hide resolved
routes.go Outdated Show resolved Hide resolved
- return an error with invalid request types
- simplify json decoding
- return error and success consistent with app conventions
- endpoint change from /api/generate/markdownify to /api/markdown
- fix nil pointer dereference when passing a base_url
@robjloranger

This comment has been minimized.

Copy link
Member Author

robjloranger commented Dec 17, 2019

ready for re-review @thebaer

@thebaer

This comment has been minimized.

Copy link
Member

thebaer commented Dec 18, 2019

Great 👍

Last change: I think we should still return that out struct (with the body property) that you had before. That way, we get backward-compatibility if we ever want to return additional properties along with the rendered Markdown in the future.

@thebaer
thebaer approved these changes Jan 3, 2020
Copy link
Member

thebaer left a comment

Looks great! Thanks, @robjloranger

@thebaer thebaer merged commit a457971 into develop Jan 3, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@thebaer thebaer deleted the markdown-API branch Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.