Skip to content

Commit

Permalink
fix(app): title argument
Browse files Browse the repository at this point in the history
  • Loading branch information
vogloblinsky committed Nov 7, 2016
1 parent 1bf00c7 commit 4b37cf2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1169,12 +1169,13 @@ let $dependenciesEngine;
let startTime = new Date();
var Application;
(function (Application) {
let defaultTitle = `Application documentation`;
program
.version(pkg.version)
.option('-f, --file [file]', 'A tsconfig.json file')
.option('-d, --output [folder]', 'Where to store the generated documentation (default: ./documentation)', `./documentation/`)
.option('-b, --base [base]', 'Base reference of html tag', '/')
.option('-n, --name [name]', 'Title documentation', `Application documentation`)
.option('-n, --name [name]', 'Title documentation', defaultTitle)
.option('-o, --open', 'Open the generated documentation', false)
.option('-t, --silent', 'In silent mode, log messages aren\'t logged in the console', false)
.option('-s, --serve', 'Serve generated documentation (default http://localhost:8080/)', false)
Expand All @@ -1193,8 +1194,8 @@ var Application;
logger.info('Searching package.json file');
$fileengine.get('package.json').then((packageData) => {
let parsedData = JSON.parse(packageData);
if (typeof parsedData.name !== 'undefined') {
$configuration.mainData.documentationMainName = parsedData.name;
if (typeof parsedData.name !== 'undefined' && program.name === defaultTitle) {
$configuration.mainData.documentationMainName = parsedData.name + ' documentation';
}
if (typeof parsedData.description !== 'undefined') {
$configuration.mainData.documentationMainDescription = parsedData.description;
Expand Down
8 changes: 5 additions & 3 deletions src/app/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ let pkg = require('../package.json'),

export namespace Application {

let defaultTitle = `Application documentation`;

program
.version(pkg.version)
.option('-f, --file [file]', 'A tsconfig.json file')
.option('-d, --output [folder]', 'Where to store the generated documentation (default: ./documentation)', `./documentation/`)
.option('-b, --base [base]', 'Base reference of html tag', '/')
.option('-n, --name [name]', 'Title documentation', `Application documentation`)
.option('-n, --name [name]', 'Title documentation', defaultTitle)
.option('-o, --open', 'Open the generated documentation', false)
.option('-t, --silent', 'In silent mode, log messages aren\'t logged in the console', false)
.option('-s, --serve', 'Serve generated documentation (default http://localhost:8080/)', false)
Expand All @@ -56,8 +58,8 @@ export namespace Application {
logger.info('Searching package.json file');
$fileengine.get('package.json').then((packageData) => {
let parsedData = JSON.parse(packageData);
if (typeof parsedData.name !== 'undefined') {
$configuration.mainData.documentationMainName = parsedData.name;
if (typeof parsedData.name !== 'undefined' && program.name === defaultTitle) {
$configuration.mainData.documentationMainName = parsedData.name + ' documentation';
}
if (typeof parsedData.description !== 'undefined') {
$configuration.mainData.documentationMainDescription = parsedData.description;
Expand Down
4 changes: 2 additions & 2 deletions src/templates/page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{{data.documentationMainName}} documentation</title>
<title>{{data.documentationMainName}}</title>
<meta name="description" content="">
<base href="{{data.base}}">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand All @@ -18,7 +18,7 @@
<body>

<nav class="navbar navbar-default navbar-fixed-top">
<a href="./" class="navbar-brand">{{data.documentationMainName}} documentation</a>
<a href="./" class="navbar-brand">{{data.documentationMainName}}</a>
<button type="button" class="btn btn-default btn-menu fa fa-bars visible-xs" id="btn-menu"></button>
</nav>

Expand Down

0 comments on commit 4b37cf2

Please sign in to comment.