@chazzz/simple-doc
Advanced tools
Comparing version 0.0.0 to 0.0.1
@@ -5,3 +5,13 @@ # Change Log | ||
<a name="0.0.1"></a> | ||
## [0.0.1](https://github.com/charjac/simple-doc/compare/v0.0.0...v0.0.1) (2017-09-26) | ||
### Bug Fixes | ||
* **export:** remove export default ([dc6092a](https://github.com/charjac/simple-doc/commit/dc6092a)) | ||
<a name="0.0.0"></a> | ||
# 0.0.0 (2017-09-26) |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = require("react"); | ||
var react_helmet_1 = require("react-helmet"); | ||
var Navbar_1 = require("../Navbar"); | ||
var Markdown_1 = require("../Markdown"); | ||
exports.MainPage = function (_a) { | ||
var markdown = _a.markdown, pkg = _a.pkg, title = _a.title, menu = _a.menu; | ||
return (react_1.default.createElement("div", null, | ||
react_1.default.createElement(react_helmet_1.Helmet, null, | ||
react_1.default.createElement("meta", { charSet: "utf-8" }), | ||
react_1.default.createElement("title", null, title), | ||
react_1.default.createElement("link", { rel: "stylesheet", href: "./github.css" }), | ||
react_1.default.createElement("link", { rel: "stylesheet", href: "./main.css" })), | ||
react_1.default.createElement(Navbar_1.Navbar, { repo: pkg.repository.url.replace('.git', ''), menu: menu, title: title }), | ||
react_1.default.createElement("div", { className: "wrap" }, | ||
react_1.default.createElement(Markdown_1.Markdown, { markdown: markdown })))); | ||
}; | ||
const React = require("react"); | ||
const react_helmet_1 = require("react-helmet"); | ||
const Navbar_1 = require("../Navbar"); | ||
const Markdown_1 = require("../Markdown"); | ||
exports.MainPage = ({ markdown, pkg, title, menu, }) => (React.createElement("div", null, | ||
React.createElement(react_helmet_1.Helmet, null, | ||
React.createElement("meta", { charSet: "utf-8" }), | ||
React.createElement("title", null, title), | ||
React.createElement("link", { rel: "stylesheet", href: "./github.css" }), | ||
React.createElement("link", { rel: "stylesheet", href: "./main.css" })), | ||
React.createElement(Navbar_1.Navbar, { repo: pkg.repository.url.replace('.git', ''), menu: menu, title: title }), | ||
React.createElement("div", { className: "wrap" }, | ||
React.createElement(Markdown_1.Markdown, { markdown: markdown })))); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = require("react"); | ||
var marked_1 = require("marked"); | ||
marked_1.default.setOptions({ | ||
renderer: new marked_1.default.Renderer(), | ||
const React = require("react"); | ||
const marked = require('marked'); | ||
marked.setOptions({ | ||
renderer: new marked.Renderer(), | ||
gfm: true, | ||
@@ -15,6 +15,6 @@ tables: true, | ||
}); | ||
exports.Markdown = function (_a) { | ||
var _b = _a.githubStyle, githubStyle = _b === void 0 ? true : _b, markdown = _a.markdown; | ||
return (react_1.default.createElement("div", { className: githubStyle ? 'markdown-github' : '', dangerouslySetInnerHTML: { __html: marked_1.default(markdown) } })); | ||
exports.Markdown = ({ githubStyle = true, markdown, }) => { | ||
console.log('markdown', markdown); | ||
return (React.createElement("div", { className: githubStyle ? 'markdown-github' : '', dangerouslySetInnerHTML: { __html: marked(markdown) } })); | ||
}; | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = require("react"); | ||
var react_helmet_1 = require("react-helmet"); | ||
var NavItem_1 = require("../NavItem"); | ||
exports.Navbar = function (_a) { | ||
var repo = _a.repo, title = _a.title, menu = _a.menu; | ||
return (react_1.default.createElement("nav", { className: "navbar navbar-expand-lg navbar-light bg-light" }, | ||
react_1.default.createElement(react_helmet_1.Helmet, null, | ||
react_1.default.createElement("link", { rel: "stylesheet", href: "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" }), | ||
react_1.default.createElement("script", { src: "https://use.fontawesome.com/3d13965eab.js" })), | ||
react_1.default.createElement("a", { className: "navbar-brand", href: "#" }, title), | ||
react_1.default.createElement("button", { className: "navbar-toggler", type: "button", "data-toggle": "collapse", "data-target": "#navbarNavDropdown", "aria-controls": "navbarNavDropdown", "aria-expanded": "false", "aria-label": "Toggle navigation" }, | ||
react_1.default.createElement("span", { className: "navbar-toggler-icon" })), | ||
react_1.default.createElement("div", { className: "collapse navbar-collapse justify-content-between", id: "navbarNavDropdown" }, | ||
!!menu && (react_1.default.createElement("ul", { className: "navbar-nav" }, menu.map(function (navItemProps) { return react_1.default.createElement(NavItem_1.NavItem, __assign({}, navItemProps)); }))), | ||
!!repo && (react_1.default.createElement("ul", { className: "navbar-nav" }, | ||
react_1.default.createElement(NavItem_1.NavItem, { url: repo, icon: "github" }), | ||
react_1.default.createElement(NavItem_1.NavItem, { url: repo + "/issues", icon: "exclamation-circle" }), | ||
react_1.default.createElement(NavItem_1.NavItem, { url: repo + "/projects", icon: "trello" })))))); | ||
}; | ||
const React = require("react"); | ||
const react_helmet_1 = require("react-helmet"); | ||
const NavItem_1 = require("../NavItem"); | ||
exports.Navbar = ({ repo, title, menu, }) => (React.createElement("nav", { className: "navbar navbar-expand-lg navbar-light bg-light" }, | ||
React.createElement(react_helmet_1.Helmet, null, | ||
React.createElement("link", { rel: "stylesheet", href: "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" }), | ||
React.createElement("script", { src: "https://use.fontawesome.com/3d13965eab.js" })), | ||
React.createElement("a", { className: "navbar-brand", href: "#" }, title), | ||
React.createElement("button", { className: "navbar-toggler", type: "button", "data-toggle": "collapse", "data-target": "#navbarNavDropdown", "aria-controls": "navbarNavDropdown", "aria-expanded": "false", "aria-label": "Toggle navigation" }, | ||
React.createElement("span", { className: "navbar-toggler-icon" })), | ||
React.createElement("div", { className: "collapse navbar-collapse justify-content-between", id: "navbarNavDropdown" }, | ||
!!menu && (React.createElement("ul", { className: "navbar-nav" }, menu.map(navItemProps => React.createElement(NavItem_1.NavItem, Object.assign({}, navItemProps))))), | ||
!!repo && (React.createElement("ul", { className: "navbar-nav" }, | ||
React.createElement(NavItem_1.NavItem, { url: repo, icon: "github" }), | ||
React.createElement(NavItem_1.NavItem, { url: `${repo}/issues`, icon: "exclamation-circle" }), | ||
React.createElement(NavItem_1.NavItem, { url: `${repo}/projects`, icon: "trello" })))))); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = require("react"); | ||
exports.NavItem = function (_a) { | ||
var url = _a.url, label = _a.label, icon = _a.icon; | ||
return (react_1.default.createElement("li", { className: "nav-item" }, | ||
react_1.default.createElement("a", { className: "nav-link", href: url }, | ||
!!icon && react_1.default.createElement("i", { className: "fa fa-" + icon, "aria-hidden": "true" }), | ||
!!label && { label: label }))); | ||
}; | ||
const React = require("react"); | ||
exports.NavItem = ({ url, label, icon, }) => (React.createElement("li", { className: "nav-item" }, | ||
React.createElement("a", { className: "nav-link", href: url }, | ||
!!icon && React.createElement("i", { className: `fa fa-${icon}`, "aria-hidden": "true" }), | ||
!!label && { label }))); | ||
//# sourceMappingURL=index.js.map |
@@ -10,62 +10,28 @@ "use strict"; | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [0, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var _this = this; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var fs_extra_1 = require("fs-extra"); | ||
var html_1 = require("html"); | ||
var MainPage_1 = require("./components/MainPage"); | ||
var render_1 = require("./render"); | ||
exports.default = function (_a) { | ||
var pkg = _a.pkg, changelog = _a.changelog, _b = _a.outDir, outDir = _b === void 0 ? process.cwd() + '/docs' : _b, _c = _a.Page, Page = _c === void 0 ? MainPage_1.MainPage : _c, title = _a.title; | ||
return __awaiter(_this, void 0, void 0, function () { | ||
var html, styleDir; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
html = render_1.default(Page, { | ||
title: title || pkg.name + " Documentation", | ||
pkg: pkg, | ||
changelog: changelog, | ||
}); | ||
styleDir = process.cwd() + "/src/style"; | ||
return [4, fs_extra_1.default.writeFile(outDir + "/index.html", html_1.prettyPrint(html))]; | ||
case 1: | ||
_a.sent(); | ||
return [4, fs_extra_1.default.copy(styleDir + "/github.css", outDir + "/github.css")]; | ||
case 2: | ||
_a.sent(); | ||
return [4, fs_extra_1.default.copy(styleDir + "/main.css", outDir + "/main.css")]; | ||
case 3: | ||
_a.sent(); | ||
return [2]; | ||
} | ||
}); | ||
const fs = require("fs-extra"); | ||
const html_1 = require("html"); | ||
const MainPage_1 = require("./components/MainPage"); | ||
const render_1 = require("./render"); | ||
exports.generateDoc = ({ pkg, markdown, outDir = process.cwd() + '/docs', Page = MainPage_1.MainPage, title, }) => __awaiter(this, void 0, void 0, function* () { | ||
const html = render_1.default(Page, { | ||
title: title || `${pkg.name} Documentation`, | ||
pkg, | ||
markdown, | ||
}); | ||
}; | ||
const styleDir = `${process.cwd()}/src/style`; | ||
try { | ||
yield fs.writeFile(`${outDir}/index.html`, html_1.prettyPrint(html)); | ||
} | ||
catch (err) { | ||
if (err.code === 'ENOENT') { | ||
yield fs.mkdir(outDir); | ||
yield fs.writeFile(`${outDir}/index.html`, html_1.prettyPrint(html)); | ||
} | ||
} | ||
finally { | ||
yield fs.copy(`${styleDir}/github.css`, `${outDir}/github.css`); | ||
yield fs.copy(`${styleDir}/main.css`, `${outDir}/main.css`); | ||
} | ||
}); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var react_1 = require("react"); | ||
var server_1 = require("react-dom/server"); | ||
var react_helmet_1 = require("react-helmet"); | ||
exports.default = function (Component, props) { | ||
var reactApp = server_1.default.renderToString(react_1.default.createElement(Component, __assign({}, props))); | ||
var helmet = react_helmet_1.Helmet.renderStatic(); | ||
return "\n <!doctype html>\n <html>\n <head>\n " + helmet.title.toString() + "\n " + helmet.meta.toString() + "\n " + helmet.link.toString() + "\n " + helmet.script.toString() + "\n </head>\n <body>\n " + reactApp + "\n </body>\n </html>\n "; | ||
const React = require("react"); | ||
const server_1 = require("react-dom/server"); | ||
const react_helmet_1 = require("react-helmet"); | ||
exports.default = (Component, props) => { | ||
const reactApp = server_1.renderToString(React.createElement(Component, Object.assign({}, props))); | ||
const helmet = react_helmet_1.Helmet.renderStatic(); | ||
return ` | ||
<!doctype html> | ||
<html> | ||
<head> | ||
${helmet.title.toString()} | ||
${helmet.meta.toString()} | ||
${helmet.link.toString()} | ||
${helmet.script.toString()} | ||
</head> | ||
<body> | ||
${reactApp} | ||
</body> | ||
</html> | ||
`; | ||
}; | ||
//# sourceMappingURL=render.js.map |
{ | ||
"name": "@chazzz/simple-doc", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"author": "Charles Jacquin <charles.jacquin@gmail.com>", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15639
17
121
1