Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep file extension. #350

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ Usage: docco [options] FILES
-e, --extension [ext] use the given file extension for all inputs
-L, --languages [file] use a custom languages.json
-m, --marked [file] use custom marked options
-k, --keepext [file] keep original file extension
11 changes: 7 additions & 4 deletions docco.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion docco.litcoffee
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ and rendering it to the specified output path.
write = (source, sections, config) ->

destination = (file) ->
path.join(config.output, path.basename(file, path.extname(file)) + '.html')
filename = (config.keepext and path.basename(file)) or path.basename(file, path.extname(file))
path.join(config.output, filename + '.html')

The **title** of the file is either the first heading in the prose, or the
name of the source file.
Expand Down Expand Up @@ -227,6 +228,7 @@ user-specified options.
extension: null
languages: {}
marked: null
keepext: false

**Configure** this particular run of Docco. We might use a passed-in external
template, or one of the built-in **layouts**. We only attempt to process
Expand Down Expand Up @@ -333,6 +335,7 @@ Parse options using [Commander](https://github.com/visionmedia/commander.js).
.option('-t, --template [file]', 'use a custom .jst template', c.template)
.option('-e, --extension [ext]', 'assume a file extension for all inputs', c.extension)
.option('-m, --marked [file]', 'use custom marked options', c.marked)
.option('-k, --keepext [file]', 'keep original file extension', c.keepext)
.parse(args)
.name = "docco"
if commander.args.length
Expand Down