Skip to content

Commit

Permalink
feat(app): external styles, override instead of deleting default folder
Browse files Browse the repository at this point in the history
  • Loading branch information
vogloblinsky committed Nov 14, 2016
1 parent 1cbb73a commit f1c626d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,27 @@ compodoc -p src/tsconfig.json

### Styling the documentation
```
compodoc -y your_folder/
compodoc -p src/tsconfig.json -y your_theme_styles/
```
Inside your folder you need to provide at least a style.css file. If you need more files you can import them.
@Example (style.css):

Inside your folder you need to provide at least a style.css file with these 5 imports as below.

```
@import "./reset.css";
@import "./bootstrap.min.css";
@import "./bootstrap-card.css";
@import "./font-awesome.min.css";
@import "./app.css";
@import "./compodoc.css";
```

Compodoc use [bootstrap](http://getbootstrap.com/) 3.3.7. You can customize Compodoc easily.

[bootswatch.com](http://bootswatch.com/) can be a good starting point. If you want to override the default theme, just provide a bootstrap.min.css file, and it will override the default one.

```
└── your_theme_styles/
├── style.css // the main css file with default imports
└── bootstrap.min.css // your bootstrap theme
```

### Serve generated documentation with compodoc
Expand Down
17 changes: 5 additions & 12 deletions src/app/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,19 +349,12 @@ export namespace Application {
}
else {
if (program.extTheme) {
fs.emptyDir(path.resolve(process.cwd() + path.sep + defaultFolder + 'styles'), function (err) {
fs.copy(path.resolve(process.cwd() + path.sep + program.extTheme), path.resolve(process.cwd() + path.sep + defaultFolder + '/styles/'), function (err) {
if (err) {
logger.error('Impossible to delete the documentation styles folder');
}
else {
fs.copy(path.resolve(process.cwd() + path.sep + program.extTheme), path.resolve(process.cwd() + path.sep + defaultFolder + '/styles/'), function (err) {
if (err) {
logger.error('Error during external styling theme copy ', err);
} else {
logger.info('External styling theme copy succeeded');
processGraphs();
}
});
logger.error('Error during external styling theme copy ', err);
} else {
logger.info('External styling theme copy succeeded');
processGraphs();
}
});
}
Expand Down

0 comments on commit f1c626d

Please sign in to comment.