asciidoctor / gulp-asciidoctor

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

Backend and templates #11

Open DevonVille opened 7 years ago

DevonVille commented 7 years ago

I want to use gulp-asciidoctor to render my adoc files to reveal.js slides asciidoctor-reveal.js has usable custom templates I've been wondering how to use it

any idea?

henriette-einstein commented 4 years ago

All mechanisms for customization of Asciidoctor are now supported. Please check if it works for you now.

sanderson-sfdc commented 4 years ago

I'm trying a simple one and it's not working for me.

const asciidoctor = require('gulp-asciidoctor')

function processAdocFiles (cb) {
    gulp.src('./content/**/*.adoc')
        .pipe(asciidoctor({
            extension: '.htm'
        }))
        .pipe(gulp.dest('./output'))
    cb()
             }

    function copyImages(cb) {
        gulp.src('./content/**/*.png')
            .pipe(gulp.dest('./output'))
        cb()
    }

    exports.process = gulp.parallel(processAdocFiles, copyImages)

All my files still have the extension .html.

Also, backend doesn't seem to be working either.

        .pipe(asciidoctor({
            backend: 'xhtml'
        }))
        .pipe(gulp.dest('./output'))
    cb()
             }

results in the same content as html5

henriette-einstein commented 4 years ago

Hello Steve,

The package „gulp-asciidoctor“ in the npm registry is completely outdated. However I can neither update it, nor can I create the package @asciidoctor/gulp-asciidoctor in npmjs due to missing credentials.

As a workaround, I have published the package based on the current source code to

@henriette-einstein/gulp-asciidoctor

If you use this package with

const asciidoctor = require(@henriette-einstein/gulp-asciidoctor')

your script will work.

Sorry for the inconveniences

@Mogztter: Maybe someone can add valid credentials to publish to @asciidoctor/gulp-asciidoctor for the Github action. I tried my own credentials, but that does not work.

Am 01.09.2020 um 03:23 schrieb Steve Anderson notifications@github.com:

I'm trying a simple one and it's not working for me.

const asciidoctor = require('gulp-asciidoctor')

function processAdocFiles (cb) { gulp.src('./content/*/.adoc') .pipe(asciidoctor({ extension: '.htm' })) .pipe(gulp.dest('./output')) cb() }

function copyImages(cb) {
    gulp.src('./content/**/*.png')
        .pipe(gulp.dest('./output'))
    cb()
}

exports.process = gulp.parallel(processAdocFiles, copyImages)

All my files still have the extension .html.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/asciidoctor/gulp-asciidoctor/issues/11#issuecomment-684135396, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5KYCGXAENEU7U2QYBWZ6LSDREJZANCNFSM4DJWBGQA.

ggrossetie commented 4 years ago

@henriette-einstein Hey! I've updated the NPM_TOKEN secret. Let me know if it's working.

henriette-einstein commented 4 years ago

Perfect!

Now it works and it is published to npmjs

Thanks a lot!

Am 01.09.2020 um 12:23 schrieb Guillaume Grossetie notifications@github.com:

@henriette-einstein https://github.com/henriette-einstein Hey! I've updated the NPM_TOKEN secret. Let me know if it's working.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asciidoctor/gulp-asciidoctor/issues/11#issuecomment-684738740, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5KYCED5HUHTC77ZPLAAW3SDTDTFANCNFSM4DJWBGQA.

sanderson-sfdc commented 4 years ago

I can confirm that updating my package.json with

"devDependencies": {
    "@henriette-einstein/gulp-asciidoctor": "^2.2.2",
...

and updating the gulpfile resolves the extension issue.

With the upgrade to npmjs, should I get the same result by doing a

npm update && npm install

or is there more to do?

sanderson-sfdc commented 4 years ago

Just tested the backend option with docbook and still saw html5 output.

const gulp = require('gulp')
//const asciidoctor = require('gulp-asciidoctor')
const asciidoctor = require('@henriette-einstein/gulp-asciidoctor')
const aDocbook = require('@asciidoctor/docbook-converter')()

function processAdocFiles (cb) {
    gulp.src('./content/**/*.adoc')
        .pipe(asciidoctor({
            backend: 'docbook'            
        }))
        .pipe(gulp.dest('./output'))
    cb()
             }

    function copyImages(cb) {
        gulp.src('./content/**/*.png')
            .pipe(gulp.dest('./output'))
        cb()
    }

    exports.process = gulp.parallel(processAdocFiles, copyImages)

Is there a step to add a backend and register it?

Edit: Added the docbook-converter package, and that didn't seem to resolve it.

henriette-einstein commented 4 years ago

Hello Steve,

you have to change the dependency and use

@asciidoctor/gulp-asciidoctor

The @henriette-einstein package will not be maintained further

The gulp file will also have to require the @asciidoctor/gulp-asciidoctor package

Am 01.09.2020 um 18:12 schrieb Steve Anderson notifications@github.com:

I can confirm that updating my package.json with

"devDependencies": { "@henriette-einstein/gulp-asciidoctor": "^2.2.2", ... and updating the gulpfile resolves the extension issue.

With the upgrade to npmjs, should I get the same result by doing a

npm update && npm install

or is there more to do?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asciidoctor/gulp-asciidoctor/issues/11#issuecomment-684968957, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5KYCBGQ5OSRQ77DJP227TSDUMO3ANCNFSM4DJWBGQA.

henriette-einstein commented 4 years ago

Hi Steve,

that looks like an error. I’l check that.

Am 01.09.2020 um 18:17 schrieb Steve Anderson notifications@github.com:

Just tested the backend option with docbook5 and still saw html5 output.

const gulp = require('gulp') //const asciidoctor = require('gulp-asciidoctor') const asciidoctor = require('@henriette-einstein/gulp-asciidoctor')

function processAdocFiles (cb) { gulp.src('./content/*/.adoc') .pipe(asciidoctor({ backend: 'docbook5'
})) .pipe(gulp.dest('./output')) cb() }

function copyImages(cb) {
    gulp.src('./content/**/*.png')
        .pipe(gulp.dest('./output'))
    cb()
}

exports.process = gulp.parallel(processAdocFiles, copyImages)

Is there a step to add a backend and register it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asciidoctor/gulp-asciidoctor/issues/11#issuecomment-684973781, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5KYCH4UBJGOEXF7BHENNDSDUNBTANCNFSM4DJWBGQA.

henriette-einstein commented 4 years ago

Hello Steve,

the error has been fixed with the latest release 2.2.5

use

npm i @asciidoctor/gulp-asciidoctor and update the require to use the @asciidoctor/gulp-asciidoctor package

Sorry for your inconveniences

Am 01.09.2020 um 18:17 schrieb Steve Anderson notifications@github.com:

Just tested the backend option with docbook5 and still saw html5 output.

const gulp = require('gulp') //const asciidoctor = require('gulp-asciidoctor') const asciidoctor = require('@henriette-einstein/gulp-asciidoctor')

function processAdocFiles (cb) { gulp.src('./content/*/.adoc') .pipe(asciidoctor({ backend: 'docbook5'
})) .pipe(gulp.dest('./output')) cb() }

function copyImages(cb) {
    gulp.src('./content/**/*.png')
        .pipe(gulp.dest('./output'))
    cb()
}

exports.process = gulp.parallel(processAdocFiles, copyImages)

Is there a step to add a backend and register it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asciidoctor/gulp-asciidoctor/issues/11#issuecomment-684973781, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5KYCH4UBJGOEXF7BHENNDSDUNBTANCNFSM4DJWBGQA.

sanderson-sfdc commented 4 years ago

No apologies! I can confirm that all works, thanks for the the rapid fix!