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

Handle multiple language sourcesets #392

Closed
ysb33r opened this issue Jun 10, 2019 · 1 comment
Closed

Handle multiple language sourcesets #392

ysb33r opened this issue Jun 10, 2019 · 1 comment
Labels
3.x Issues related to the 3.x enhancement
Milestone

Comments

@ysb33r
Copy link
Member

ysb33r commented Jun 10, 2019

Allow a task to handle a sourceset for various languages.

Where we are today

Consider that we have a standard setup like

asciidoctor {
    sourceDir 'src/docs/asciidoc'
    sources {
        include 'index.adoc'
    }
    resources {
        include 'images/**'
    }
    outputDir "${buildDir}/asciidoc"
}

This infers a normal layout of

src/docs/asciidoc/index.adoc
                 /images/*.*

The outputs will end up in build/asciidoc (assuming a conventionalbuildDir).

What we want to add

If we now add a DSL keyword such that

asciidoctor {
    languages 'en', 'es'
}

it will imply that we have an English and a Spanish sourceset and that the file layout will now be

src/docs/asciidoc/en/index.adoc
                 /en/images/**
                 /es/index.adoc
                 /es/images/**

Outputs will now end up in

build/asciidoc/en
              /es

We shall need to accommodate the use case where resources could be language specific

asciidoctor {
    resources 'en', {
    }
    resources 'es', {
    }
}

and this will only copy that specific resources when the specific language is being processed.

Keeping current behaviour

If the languages keyword is not used, the bhevaiour will be exactly as it is today.

Dealing with multiple backends

For the case of combining backends and languages

asciidoctor {
    outputOptions {
        backends 'html', 'docbook'
    }

    languages 'en', 'es'
}

the outputs will be

build/asciidoc/en/html
                 /docbook
              /es/html
                 /docbook

Other things to deal with

  • Intermediate work directories
@ysb33r ysb33r added enhancement 3.x Issues related to the 3.x labels Jun 10, 2019
@ysb33r ysb33r mentioned this issue Jun 10, 2019
24 tasks
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Jun 12, 2019
ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Jun 12, 2019
ysb33r added a commit that referenced this issue Jun 12, 2019
Generate documents from multiple language sources (#392)
@ysb33r ysb33r added this to the 3.0.0 milestone Jun 12, 2019
@ysb33r ysb33r closed this as completed Jun 12, 2019
@mojavelinux
Copy link
Member

Totally agree. Looks good. Languages as a facet is the right way to go.

ysb33r added a commit to ysb33r/asciidoctor-gradle-plugin that referenced this issue Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issues related to the 3.x enhancement
Projects
None yet
Development

No branches or pull requests

2 participants