├── .babelrc ├── .eslintignore ├── .eslintrc.json ├── .gitignore ├── .npmignore ├── .travis.yml ├── CHANGELOG.md ├── README.md ├── package.json ├── screenshot.png ├── src ├── components │ ├── app.js │ ├── content │ │ ├── description.js │ │ ├── example.js │ │ ├── examples.js │ │ ├── extends.js │ │ ├── index.js │ │ ├── param.js │ │ ├── params.js │ │ ├── returns.js │ │ ├── section-group.js │ │ ├── section-member.js │ │ ├── section.js │ │ ├── see.js │ │ ├── signature.js │ │ ├── source-link.js │ │ ├── throws.js │ │ └── type.js │ ├── header.js │ ├── html.js │ ├── navigation.js │ └── styles.js ├── index.js └── utils.js ├── test ├── components │ ├── app-test.js │ ├── extends-test.js │ ├── index.spec.js │ ├── returns-test.js │ ├── see-test.js │ ├── source-link-test.js │ └── throws-test.js └── utils.spec.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react", "es2015"] 3 | } 4 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | lib -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["standard-react"], 3 | "rules": { 4 | "react/prop-types": 0 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | coverage 3 | .nyc_output 4 | lib 5 | 6 | *.log -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | coverage 2 | *.log 3 | .nyc_output -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | 4 | matrix: 5 | include: 6 | - node_js: 6 7 | env: 8 | - SAUCE=true 9 | - CXX=g++-4.8 10 | - node_js: 8 11 | env: CXX=g++-4.8 12 | 13 | script: 14 | - npm run lint 15 | - npm test 16 | - npm run coverage 17 | 18 | before_script: 19 | - export DISPLAY=:99.0 20 | - sh -e /etc/init.d/xvfb start 21 | 22 | addons: 23 | firefox: latest 24 | apt: 25 | sources: 26 | - ubuntu-toolchain-r-test 27 | packages: 28 | - g++-4.8 29 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | ## [0.5.2](https://github.com/dignifiedquire/clean-documentation-theme/compare/v0.5.1...v0.5.2) (2017-09-04) 3 | 4 | 5 | ### Bug Fixes 6 | 7 | * new project url place ([d3243d9](https://github.com/dignifiedquire/clean-documentation-theme/commit/d3243d9)) 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Clean Documentation Theme 2 | 3 | [![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) 4 | [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) 5 | [![Build Status](https://travis-ci.org/dignifiedquire/clean-documentation-theme.svg?style=flat-square)](https://travis-ci.org/dignifiedquire/clean-documentation-theme) [![Coverage Status](https://coveralls.io/repos/github/dignifiedquire/clean-documentation-theme/badge.svg?branch=master)](https://coveralls.io/github/dignifiedquire/clean-documentation-theme?branch=master) 6 | [![Dependency Status](https://david-dm.org/dignifiedquire/clean-documentation-theme.svg?style=flat-square)](https://david-dm.org/dignifiedquire/clean-documentation-theme) 7 | [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) 8 | ![](https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square) 9 | ![](https://img.shields.io/badge/Node.js-%3E%3D4.0.0-orange.svg?style=flat-square) 10 | 11 | > A theme for [documentationjs](https://github.com/documentationjs) 12 | 13 | ![](screenshot.png) 14 | 15 | ## Preview 16 | 17 | - http://libp2p.github.io/js-peer-id/ 18 | 19 | 20 | It uses [React](https://facebook.github.io/react/) server side rendering with [Radium](https://github.com/FormidableLabs/radium/) for styling components. 21 | 22 | ## Usage 23 | 24 | ```bash 25 | $ npm install --save-dev clean-documentation-theme 26 | $ npm install --save-dev documentation 27 | ``` 28 | 29 | Add to your `package.json` 30 | 31 | ```json 32 | "scripts": { 33 | "docs": "documentation build --format html --theme node_modules/clean-documentation-theme --o docs 34 | " 35 | ... 36 | } 37 | ``` 38 | 39 | and run 40 | 41 | ``` 42 | $ npm run docs 43 | ``` 44 | 45 | ## License 46 | 47 | MIT 48 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "clean-documentation-theme", 3 | "version": "0.5.1", 4 | "description": "Theme for documentation.js", 5 | "main": "lib/index.js", 6 | "scripts": { 7 | "test": "npm run build && aegir test -t node", 8 | "lint": "aegir lint", 9 | "build": "babel src -d lib", 10 | "dev": "babel src -d lib --watch", 11 | "release": "npm run build && aegir release -t node --no-build --no-docs", 12 | "release-minor": "npm run build && aegir release -t node --type minor --no-build --no-docs", 13 | "release-major": "npm run build && aegir release -t node --type major --no-build --no-docs", 14 | "coverage": "nyc npm test" 15 | }, 16 | "keywords": [ 17 | "doc", 18 | "docs", 19 | "documentation", 20 | "documentation.js", 21 | "jsdoc", 22 | "jsdoc3", 23 | "theme" 24 | ], 25 | "author": "Friedel Ziegelmayer ", 26 | "license": "MIT", 27 | "dependencies": { 28 | "babel-plugin-transform-inline-imports-commonjs": "^1.2.0", 29 | "concat-stream": "^1.6.0", 30 | "documentation": "^5.3.0", 31 | "documentation-theme-utils": "^3.0.0", 32 | "github-slugger": "^1.1.3", 33 | "highlight.js": "^9.12.0", 34 | "lodash": "^4.17.4", 35 | "prop-types": "^15.5.10", 36 | "radium": "^0.19.4", 37 | "radium-bootstrap-grid": "^0.1.8", 38 | "react": "^15.6.1", 39 | "react-dom": "^15.6.1", 40 | "react-icons": "^2.2.5", 41 | "react-pure-render": "^1.0.2", 42 | "vinyl": "^2.1.0", 43 | "vinyl-fs": "^2.4.4" 44 | }, 45 | "devDependencies": { 46 | "aegir": "^12.0.2", 47 | "babel-cli": "^6.26.0", 48 | "babel-preset-es2015": "^6.24.1", 49 | "babel-preset-react": "^6.24.1", 50 | "babel-register": "^6.26.0", 51 | "chai": "^4.1.2", 52 | "enzyme": "^2.9.1", 53 | "eslint-config-standard-react": "^5.0.0", 54 | "eslint-plugin-react": "^7.3.0", 55 | "nyc": "^11.1.0", 56 | "react-addons-test-utils": "^15.6.0", 57 | "remark": "^8.0.0" 58 | }, 59 | "nyc": { 60 | "reporter": [ 61 | "lcov", 62 | "text-summary" 63 | ], 64 | "report-dir": "./coverage" 65 | }, 66 | "repository": { 67 | "type": "git", 68 | "url": "git@github.com:dignifiedquire/clean-documentation-theme.git" 69 | }, 70 | "bugs": { 71 | "url": "https://github.com/dignifiedquire/clean-documentation-theme/issues" 72 | }, 73 | "homepage": "https://github.com/dignifiedquire/clean-documentation-theme", 74 | "contributors": [ 75 | "dignifiedquire ", 76 | "ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ " 77 | ] 78 | } 79 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dignifiedquire/clean-documentation-theme/2a01efb8dcdc3176805f74790f25213d3e3a062c/screenshot.png -------------------------------------------------------------------------------- /src/components/app.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const React = require('react') 4 | const PropTypes = require('prop-types') 5 | const Radium = require('radium') 6 | const {StyleRoot} = Radium 7 | const {Container, Column, Row} = require('radium-bootstrap-grid') 8 | 9 | const Header = require('./header') 10 | const Nav = require('./navigation') 11 | const Content = require('./content') 12 | const {lineHeight} = require('./styles') 13 | const Utils = require('../utils') 14 | 15 | const hasMembers = (doc) => { 16 | const m = doc.members 17 | return m.static.length > 0 || 18 | m.instance.length > 0 || 19 | (m.events && m.events.length > 0) 20 | } 21 | 22 | const App = ({options, docs}) => { 23 | const containerStyle = { 24 | paddingTop: lineHeight(4) 25 | } 26 | 27 | const navItems = docs.map((doc) => { 28 | return { 29 | name: doc.name, 30 | members: hasMembers(doc) ? doc.members : null 31 | } 32 | }) 33 | 34 | const navStyle = { 35 | position: 'fixed', 36 | height: '80%', 37 | maxWidth: '300px' 38 | } 39 | 40 | const utils = new Utils(options, docs) 41 | const radiumConfig = { 42 | userAgent: 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36' 43 | } 44 | return ( 45 | 46 |
50 | 51 | 52 | 53 | 57 |