{"id":17181522,"url":"https://github.com/dimitarchristoff/doctor","last_synced_at":"2025-10-23T07:39:50.875Z","repository":{"id":6169210,"uuid":"7398976","full_name":"DimitarChristoff/doctor","owner":"DimitarChristoff","description":"Doctor, .MD to living HTML docs convertor for node.js","archived":false,"fork":false,"pushed_at":"2015-03-06T17:57:00.000Z","size":1275,"stargazers_count":13,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T03:32:06.392Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://dimitarchristoff.github.com/doctor/","language":"CSS","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/DimitarChristoff.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":"2013-01-01T21:01:41.000Z","updated_at":"2019-07-11T14:50:20.000Z","dependencies_parsed_at":"2022-09-14T19:52:26.105Z","dependency_job_id":null,"html_url":"https://github.com/DimitarChristoff/doctor","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimitarChristoff%2Fdoctor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimitarChristoff%2Fdoctor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimitarChristoff%2Fdoctor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimitarChristoff%2Fdoctor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DimitarChristoff","download_url":"https://codeload.github.com/DimitarChristoff/doctor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248758002,"owners_count":21156955,"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-15T00:34:34.312Z","updated_at":"2025-10-12T19:46:51.006Z","avatar_url":"https://github.com/DimitarChristoff.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"Doctor, MD to HTML documentation generator for nodejs\n=====================================================\n\nDoctor is MD (er. markdown) to HTML doc generator for node. The viewer is powered by Bootstrap and MooTools. Generation\n happens entirely client-side and can work offline or through remote URLs of markdown documents.\n\n## Using as a CLI tool\n\nYou can just clone the repo and run it.\n\n```sh\n$ git clone https://github.com/DimitarChristoff/doctor\n$ npm install .\n$ ./doctor.js -i README.md # agaist a local file\n$ ./doctor.js -i https://raw.github.com/DimitarChristoff/Epitome/master/README.md -o ../www/webclient/src/docs/ # run against a remote file\n$ ./doctor.js -i docs.md -o ../built/ -t \"My documentation\" --logo http://domain.io/img/logo.png # custom title and build loc\n```\n\n## Using under nodejs\n\nYou can also use it as an npm module from within nodejs scripts.\n\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar doc = require('doctor-md');\ndoc.process({\n    source: 'readme.md',\n    output: '../docs/',\n    title: 'My title',\n    twitter: 'D_mitar',\n    pageTemplate: 'tpl/mydocs.hbs', // handlebars,\n    analytics: 'UA-1199722-4', // id here\n    github: 'https://github.com/DimitarChristoff/doctor',\n    disqus: 'doctor-md',\n    // travis: '',\n    logo: 'images/logo.png',\n    less: 'less/bootstrap.less',\n    less: '../bootstrap/less/bootstrap.less' // custom less file\n});\n```\nJust add it to your package.json, `npm install` or `npm link` and start requiring it. See `lib/builder.js` to get an idea\nof the methods you can call and use.\n\n### Events under nodejs\n\nThe `builder` supports the following events\n\n - `html` - fired when HTML processing is done. `this.html` points to processed markup.\n - `pre` - fired before writing of files takes place, allowing to script any last minute changes\n - `docs` - fired when the HTML file is written to the file system\n - `css` - fired when the compiled (via recess) CSS is written to the file system\n - `js` - fired when the extra js files are copied to the build folder\n - `images` - fired when the extra images files are copied to the build folder\n - `error` - fired when any file operation or compilation fails.\n\nThe `builder` instance is available on the `doctor` instance as `this.builder`.\n\nHere is an example use under nodejs:\n```javascript\nvar doc = require('doctor-md');\n\ndoc.builder.on('error', function(msg){\n    console.log('error', msg);\n});\n\ndoc.builder.on('html', function(){\n    console.log('html ready!');\n});\n\ndoc.builder.on('pre', function(){\n    console.log(this.html); // can mod this.html before it's written\n});\n\n// when all tasks are done\ndoc.on('done', function(){\n\tconsole.log('done');\n});\n\n// when tasks dont work\ndoc.on('error', function(msg){\n\tconsole.error(msg);\n});\n\ndoc.process({\n    source: 'readme.md'\n});\n```\n\n## Using global CLI\n\nYou can install doctor as a global binary available within your npm env:\n\n```sh\n$ npm install -g doctor-md\n$   .         .\n  ,-| ,-. ,-. |- ,-. ,-.\n  | | | | |   |  | | |\n  `-^ `-' `-' `' `-' ' 0.1.10\n\n    --help, -h      : Help using doctor\n    --input, -i     : Input file or URI -i path/to/file.md or -i http://domain.com/file.md\n    --output, -o    : Output folder -o ./build, defaults to ./build\n    --title, -t     : Set page title -t \"My title here\", defaults to \"Built by doctors\"\n    --twitter, -@   : Add twitter follow button -@ D_mitar\n    --github, -g    : Add github repo link, issues and fork ribbon -g https://github.com/mootools/prime/\n    --analytics, -a : Add google analytics tracking id -a UA-1199722-3\n    --disqus, -d    : Add disqus comments, pass disqus forum name -d doctor-md\n    --ci, -c        : Add TravisCI build status badge -c http://travis-ci.org/DimitarChristoff/Epitome\n    --template      : Use a custom handlebars template file --template ./tpl/docs.hbs\n    --js            : Use a custom js/ folder to deploy to dist/js --js ./lib/js\n    --images        : Use a custom images/ folder to deploy to dist/images --images ./lib/images\n    --less, -l      : Use a custom less/bootstrap.less dir to compile css --l ./less/custom.less\n    --logo          : Use a custom logo in header --logo http://domain.io/img/logo.png\n\n$ doctor -i README.md -@ D_mitar -g https://github.com/DimitarChristoff/Epitome -t 'Epitome MVC Framework' -c http://travis-ci.org/DimitarChristoff/Epitome --logo images/logo.png -a UA-1199722-4\n```\n\n## Using under Grunt\n\nYou can now use it as a grunt plugin - https://github.com/DimitarChristoff/grunt-doctor-md, it has support for post processing via assemble and grunt-contrib-copy,\nsee the supplied `Gruntfile.js` as an example of the config object.\n\n\n## Customisation\n\nYou can change the page.hbs handlebars template and edit the .less files, which are compiled in the build. If you edit\n`builder.js` and add properties to the template engine - it will accept `github` and `travis` already.\n\n### Runnable code\n\nDoctor now supports runable code blocks via ACE and an iframe hack. In order to create a block of code that runs with syntax highlighting,\nyou need to tag it as `ace`, so start via ````ace`. Here is an example that will produce an alert below:\n\n```ace\nalert('this code just run');\n\n```\n\nYou should move any files you want to have available into the deployable `js` folder. RequireJS is loaded automatically\nvia `blank.html` from the `js` folder from the cdnjs.com repo, the rest is up to you.\n\n## Partials support\n\nYou can nest different MD files so they are also included into your build like so:\n\n\u003cdiv class=alert\u003e__{{\u0026gt;todo.md}}__\u003c/div\u003e\n\nThe actual output of this will be seemless:\n{{\u003etodo.md}}\n\n\u003cdiv class=alert\u003eThe todo section above was read from `todo.md`, it's not real See the readme.md on github.\u003c/div\u003e\n\n## Deployment\n\nYou can use in projects to create `gh-pages` on the fly. If your git implementation supports `git subtreee`, you can:\n\n```sh\n$ git subtree push --prefix build origin gh-pages\n```\n\nThe above will take the contents of the `build` folder or wherever your output is and push it into the `gh-pages` branch.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitarchristoff%2Fdoctor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimitarchristoff%2Fdoctor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitarchristoff%2Fdoctor/lists"}