{"id":15603494,"url":"https://github.com/codemeasandwich/auto-docs","last_synced_at":"2025-09-14T19:38:34.872Z","repository":{"id":57187249,"uuid":"113579667","full_name":"codemeasandwich/auto-docs","owner":"codemeasandwich","description":"A screenshot \u0026 markdown generator","archived":false,"fork":false,"pushed_at":"2019-01-30T13:40:45.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-07T11:44:49.509Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codemeasandwich.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-08T13:53:40.000Z","updated_at":"2019-01-30T13:40:47.000Z","dependencies_parsed_at":"2022-08-28T13:00:19.037Z","dependency_job_id":null,"html_url":"https://github.com/codemeasandwich/auto-docs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codemeasandwich/auto-docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemeasandwich%2Fauto-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemeasandwich%2Fauto-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemeasandwich%2Fauto-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemeasandwich%2Fauto-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemeasandwich","download_url":"https://codeload.github.com/codemeasandwich/auto-docs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemeasandwich%2Fauto-docs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266052533,"owners_count":23869475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T03:03:38.248Z","updated_at":"2025-07-20T01:05:48.901Z","avatar_url":"https://github.com/codemeasandwich.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## A screenshot \u0026 markdown generator\n\n[![npm version](https://badge.fury.io/js/auto-docs.svg)](https://www.npmjs.com/package/auto-docs)\n\n\n### Installing\n\n* npm install -g testcafe\n* npm install -g docsify-cli\n* npm install --save-dev auto-docs\n\n### In you package.json\n\n```json\n\n  \"scripts\": {\n    \"manual\": \"testcafe \\\"chrome:headless --kiosk --incognito --force-device-scale-factor=1.5\\\" node_modules/auto-docs/ -s docs/pics\",\n    \"files\": \"node node_modules/auto-docs/\",\n    \"serve\": \"docsify serve docs\"\n  }\n\n```\n\n**To generate with screenshots** `npm run manual`\n\nalso \n\n**To run without [brower commands](#brower-commands) use** `npm run files`\n\nOnce generated.\n\n**To run document server** `npm run serve`\n\nHow you can open [localhost:3000](http://localhost:3000)\n\n\n# Api\n\n### brower commands\n\n* navigateTo: go to a given url - (url)\n* typeText: enter text into an input - (selecter,text)\n* click: click on an element - (selecter)\n\n### document commands\n\n* description: Add basic text to document - (text)\n* screenshot: Capture the screen and add to document - (screenshot_name,[diff]) ***diff** defult to `true`* check if the screen has chacked\n* link: Add a link to document (title,url)\n* img: Add a image to document (title,url)\n* lang: apply translation from ##.json `` lang`message` ``\n    * Injects new text into language json file if new/missing\n    * generating of language json file if missing\n    * With value passion recording. Used in language like *Arabic, Chinese, Hindi, Japanese etc..*\n* code: Add a block of code to document (source,[type]) ***type** of optional*\n* pageBreak: Add a link break to document () ~ No arguments\n* title: Add a heading to document (text) or (level,text) *to set the depth of the sub heading*\n* youtube: A thumbnail link to a video (video_id,[start from X sec]) ***start** of optional*\n    * You will need a \"playbutton.png\" in your \"pics\" folder\n    * You will also need the CSS to place the button\n\n\u003cdetails\u003e\u003csummary\u003eCSS: youtube button placement\u003c/summary\u003e\u003cbr\u003e\n\nAdd this CSS\n```\n\u003cstyle\u003e\np{\n  position: relative;\n}\nimg[alt='videobutton']{\n    pointer-events: none;\n    position: absolute;\n    z-index: 3;\n    top: calc( 50% - 50px);\n    left: calc( 50% - 50px);\n    width: 100px;\n}\n\u003c/style\u003e\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eJS: embed youtube video\u003c/summary\u003e\u003cbr\u003e\n\nAdd this index.html\n```JS\nwindow.$docsify = {\n\n  plugins: [\n   function (hook, vm) {\n      hook.afterEach(function(html, next) {\n\n        if(html.includes(\"youtube\")){\n\n            $(html).find(\"img[src*='youtube']\").parent().toArray()\n                                                        .map(elem =\u003e $(elem))\n                                                        .forEach( elemA =\u003e{\n\n              const link  = elemA.attr(\"href\")\n              const [id ,time]   = link.split(\"/\").pop().split(\"?\")\n\n              const start = time ? time.match(/\\d+/)[0] : 0\n\n              const elemToReplace = elemA.parent().html().replace(new RegExp(\" data-origin=\", \"g\"),\"data-origin=\")\n\n              const newElem = `\u003ciframe width=\"100%\" height=\"433\" src=\"https://www.youtube.com/embed/${id}?start=${start}\" frameborder=\"0\" gesture=\"media\" allow=\"encrypted-media\" allowfullscreen\u003e\u003c/iframe\u003e`\n              html = html.replace(elemToReplace,newElem)\n\n            } )\n\n        }\n        next(html)\n\n      })\n   }\n ]\n\n// ...\n\n}\n\n```\n\n\u003c/details\u003e\n\n## Config file\n\nFrom with the manual folder you should place a **config.json** file\n\nExample:\n\n```json\n{\n  \"server\":\"http://localhost:3000/myapp/\",\n  \"only\":[\"1-Welcome\",\"1-How to log in\"],\n  \"waitBeforeScreenShot\":1000,\n  \"login\":{\n    \"user\":[\"#username\", \"admin\"],\n    \"pass\":[\"#password\", \"admin\"],\n    \"url\":\"login.html\",\n    \"button\":\"#loginButton\"\n  }\n}\n```\n* server: the path to your server\n* only: An array of file steps to the page you want to regenerate  *optional!*\n* waitBeforeScreenShot: how long to wite for taking a ScreenShot *optional!* (Default: 0)\n* login: login credentials to use\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemeasandwich%2Fauto-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemeasandwich%2Fauto-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemeasandwich%2Fauto-docs/lists"}