diff --git a/README.md b/README.md index e2b9c80..d90d147 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,27 @@ golang url to mark-down API -gorltom is a simple to use API that takes in a full url +gorltom is a simple to use API that takes in a full url as a string on this endpoint: https://gorltom.corbia.net/api/url -And returns a markdown file with the following format: +It will then open the page with chromedp (just in case we need to wait for some JS generated content...) and will then take this html atrocity: ```html + + + + + Title of the example webpage +
+
+
+ + + ``` +And return this beautiful markdown as a string: + ```md -# Title of the example webpage -# (*gorltom extract of https://notexample.com/*) - -# *assumed_menu* -- [ABOUT](https://notexample.com/about) -- [BLOG](https://notexample.com/blog) - -# *article* - -### Title of the article - -Text of the first paragraph of the article. - -Text of the second paragraph of the article - -Text of the third paragraph of the article but this time it contains a [link]("https://link-to-another-website.com/example") inside of the text. - -``` - # Title of the example webpage ###### (*gorltom extract of https://notexample.com/*) @@ -88,4 +82,55 @@ Text of the first paragraph of the article. Text of the second paragraph of the article -Text of the third paragraph of the article but this time it contains a [link]("https://link-to-another-website.com/example") inside of the text. \ No newline at end of file +Text of the third paragraph of the article but this time it contains a [link]("https://link-to-another-website.com/example") inside of the text. + +``` + +The API will be expecting the following JSON: + +```json +{ + "url": "https://full-url-of.com/the/page" +} +``` + +And will return the following: +```json +{ + "md" : "# Home of full-url-of\n###### (*gorltom extract of https://full-url-of.com/the/page*)\n\n## Some header\n\n#### A tagline maybe\n\n###### *assumed_menu*\n- [HTML for newbies](https://full-url-of.com/html)\n- [CSS for artists](https://full-url-of.com/css)" +} +``` + +gorltom is opiniated. + +Every nav is treated as an "assumed_menu", if the html contains `
` or `
` tags, it will be indicated in the markdown version. + +Every table will be turned into csv + +```html + + + + + + + + + + + + + + + +
First NameAge
Alice32
Bob34
+``` + +```csv +First Name,Age +Alice, 32 +Bobo, 34 +``` + +The HTML is parsed from top to bottom, node after node. + diff --git a/index.html b/index.html index d01f779..9012089 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,22 @@ Document - + + + + + + + + + + + + + + + + +
First NameAge
Alice32
Bob34
\ No newline at end of file