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

Base URL option #24

Merged
merged 5 commits into from
May 6, 2013
Merged
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 .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
npm-debug.log
tmp/

.DS_Store?
ehthumbs.db
Expand Down
7 changes: 4 additions & 3 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = (grunt) ->

# Configure
# ---------
# Configuration
# -------------

grunt.initConfig

Expand All @@ -11,6 +11,7 @@ module.exports = (grunt) ->
docs: ['docs/*']
lib: ['lib/*']
dist: ['dist/*']
test: ['tmp']

coffee:
all:
Expand Down Expand Up @@ -46,4 +47,4 @@ module.exports = (grunt) ->

grunt.registerTask 'build', ['clean', 'coffee', 'docco', 'uglify']
grunt.registerTask 'default', ['build', 'test']
grunt.registerTask 'test', ['nodeunit']
grunt.registerTask 'test', ['clean:test', 'nodeunit']
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ $ md -l .

-h, --help output usage information
-V, --version output the version number
-a, --absolute always use absolute URLs for links
-a, --absolute always use absolute URLs for links and images
-b, --base <url> set base URL to resolve relative URLs from
-d, --debug print additional debug information
-e, --eval pass a string from the command line as input
-i, --inline generate inline style links
Expand Down Expand Up @@ -122,7 +123,11 @@ The following options are recognised by this method (all of which are optional);
</tr>
<tr>
<td>absolute</td>
<td>All links are parsed with absolute URLs</td>
<td>All links and images are parsed with absolute URLs</td>
</tr>
<tr>
<td>base</td>
<td>All relative links and images are resolved from this URL</td>g
</tr>
<tr>
<td>debug</td>
Expand All @@ -134,6 +139,8 @@ The following options are recognised by this method (all of which are optional);
</tr>
</table>

**Note:** The `base` option *only* works in the [node.js][] environment.

### Miscellaneous

#### `noConflict()`
Expand Down
2 changes: 1 addition & 1 deletion dist/md.min.js

Large diffs are not rendered by default.

29 changes: 15 additions & 14 deletions docs/command.html

Large diffs are not rendered by default.

159 changes: 79 additions & 80 deletions docs/md.html

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions lib/command.js

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

75 changes: 32 additions & 43 deletions lib/md.js

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

14 changes: 13 additions & 1 deletion man/md.1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
.I output_dir
]
[
.B \-b
.I base_url
]
[
.I paths
]
.br
Expand All @@ -40,7 +44,15 @@ systems to provide a complete command line utility.

.TP 15
.B \-a/\-\-absolute
Always use absolute URLs for converted links.
Always use absolute URLs for converted links and
images.

.HP
.B \-b/\-\-base
.I url
.br
Specifies the base URL to resolve relative URLs
from.

.TP
.B \-d/\-\-debug
Expand Down
Loading