asciidoctor / gulp-asciidoctor

gulp-asciidoctor
https://www.npmjs.com/package/@asciidoctor/gulp-asciidoctor
14 stars 8 forks source link

include:: Syntax Not Working #5

Closed craigshoemaker closed 4 years ago

craigshoemaker commented 9 years ago

When trying to combine separate documents using the include:: syntax, instead of getting the contents of the file injected into the generated file, it just generates an anchor linking to the file like this:

<div class="paragraph">
<p><a href="document1.txt" class="bare">document1.txt</a></p>
</div>

Is there a parameter I need to send in to tell the plugin to support includes?

dongwq commented 9 years ago

which safe mode are you used? '

craigshoemaker commented 9 years ago

Since I wasn't passing in a value, I was just using the default. Here's my gulpfile.js:

var gulp = require('gulp');
var watch = require('gulp-watch');
var asciidoctor = require('gulp-asciidoctor');

gulp.task('adoc', function() {

    watch(['./src/*.adoc'], function(){
        gulp.src('./src/*.adoc')
            .pipe(asciidoctor({
                attributes: ['silverlight']
            }))
            .pipe(gulp.dest('./dest'));
    });

});

gulp.task('default', ['adoc']);

I'm not sure from the readme.adoc what the argument would be to run it "not in safe mode".

Thanks!

mojavelinux commented 8 years ago

I think the build plugins should set the safe mode to unsafe by default to be consistent. The Maven and Gradle plugins do this already.

dongwq commented 8 years ago

@mojavelinux when the save mode is been set to 'unsafe' , two more tests failed.

stormbeta commented 8 years ago

This appears to still be an issue, and setting safe=unsafe in the gulp attributes didn't help. It still just creates a link instead of actually including the target file.

mojavelinux commented 8 years ago

setting safe=unsafe in the gulp attributes

That's because the safe mode isn't an attribute, it's an option.

See this test: https://github.com/asciidoctor/gulp-asciidoctor/blob/966cf492abe3430c2512443daa316c901aeb1cd6/test.js#L101-L105

That test needs to be enabled. Then we can be sure the feature works.

henriette-einstein commented 4 years ago

Pull request #13 will probably solve this issue.

I assume, that the underlying problem was, that relative paths were not handled. Only the base_dir option of AsciiDoctor worked

henriette-einstein commented 4 years ago

This issue is now fixed and outdated