Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Schalk W. Cronjé
    @ysb33r
    spring-restdocs has finally bit the bullet and made some updates so that it can be compatible with AsciidoctorJ 1.6 & 2.0. It will be in 2.0.4-SNAPSHOT for now (https://github.com/spring-projects/spring-restdocs/issues/581#issuecomment-503068051)
    Dan Allen
    @mojavelinux
    excellent!!!
    given that they are meeting us half way on this, we should return the favor by staying as true to semver as possible
    BenDenger
    @BenDenger

    hey guys, how can i reference code snippets, located in different files?
    in my .adoc file i have:

    [source,kotlin]
    ----
    include::../test.kt[lines=3..5]
    ----

    expecting to have printed out the code in there, but all i get is link:../test.kt[]
    i am doing that with the code

    val options = OptionsBuilder.options()
                        .safe(SafeMode.UNSAFE)
                        .baseDir(unzippedRoot)
                        .docType("article")
                Asciidoctor.Factory.create().load(excerpt, options.asMap())

    am i doing something wrong?

    BenDenger
    @BenDenger
    just figured out that my baseDir was wrong ;D
    Ashok Koyi
    @thekalinga

    Hi,

    I am trying to use include snippets from external files. These files are relative to .adoc file. When I build the html file, the build succeeds. But when I try to use pdf generation, the files are resolved relative to root directory.

    Any idea why this is the case?

    You can find the sample project here

    https://github.com/thekalinga/asciidoctor-2-test

    Html file generation is fine, but not pdf generation*
    Jorge Aguilera
    @jorge.aguilera_gitlab
    Ashok Koyi
    @thekalinga

    @jorge.aguilera_gitlab Thanks for sharing that. I am quite new to asciidoctor. I went over it, but could not fully figure it out. (I am quite new to asciidoctor)

    Is this responsible for copying & referring to files?

    asciidoctorPdf{
        useIntermediateWorkDir()
        baseDirFollowsSourceDir()
        logDocuments true
        resources{
            from(sourceDir) {
                include '**'
            }
        }
    More specifically, Is this responsible?
        resources{
            from(sourceDir) {
                include '**'
            }
        }
    Jorge Aguilera
    @jorge.aguilera_gitlab
    yes
    Ashok Koyi
    @thekalinga
    If we have files with duplicate names in the file tree, I need the asciidoc file to pick the file from its sibling directory

    I have limited knowledge inboth gradle & asciidoc, but I believe this would pick wrong file incase if we have files with duplicate names

    i.e

    src/docs/asciidoc/
      child1/
        index.adoc
        snippets/test.java
      child2/
        index.adoc
        snippets/test.java

    In this case, I want child1/index.pdf to include child1/snippets/test.java & child2/index.pdf to include child2/snippets/test.java

    This would fail. Is that correct?
    Jorge Aguilera
    @jorge.aguilera_gitlab
    the idea is every index include their relative java
    I'll clone your repo and check it
    Ashok Koyi
    @thekalinga
    Thanks a lot
    Just gimme a sec. I'll update the sample project with this specific config
    Jorge Aguilera
    @jorge.aguilera_gitlab
    @thekalinga I've forked your repo and add some examples. Please check it at https://github.com/jagedn/asciidoctor-2-test
    Ashok Koyi
    @thekalinga
    Thanks a lot. I'll fork it and check that
    Ashok Koyi
    @thekalinga

    @jorge.aguilera_gitlab Hi, I went over what you shared. However, I have a slightly different need

    I have updated my repo now (took some of the changes from your cloned repo). ./gradlew asciidoctor fails for some reason saying it cannot find included files

    Appreciate if you can help me
    I need to generate multiple parts & depending on the need, I manually share group & share a combination of these parts
    Ashok Koyi
    @thekalinga
    Basically, I prepare training material for multiple courses. Based on the course, I would want to group them under their own nested folders & generate one/more artifacts per course
    Jorge Aguilera
    @jorge.aguilera_gitlab
    HI @thekalinga , I recreated my fork with your last repo. I hope this is what you are looking for:
    in this repo you have 2 courses (courseA for java and courseB for groovy) both of them using specific and general content
    courseA include a common welcome.adoc + copyright.adoc and a Test.java
    courseB include the same welcome.adoc + copyright.adoc and Test.groovy
    Ashok Koyi
    @thekalinga
    At various nested depths & preferably with duplicate included file names aswell.
    This is the rough layout
    src/docs/asciidoc/
      java/
        welcome.adoc
        snippets/Test.java
      groovy/
        welcome.adoc
        copyright.adoc
        snippets/
          Test.groovy
          Test.java
    That should generate
    build/docs/
      asciidoc/
        java/welcome.html
        groovy/
          welcome.html
          copyright.html
      asciidocPdf/
        java/welcome.pdf
        groovy/
          welcome.pdf
          copyright.pdf
    Ashok Koyi
    @thekalinga
    With one minor caveat :)
    Ability to highlight lines [looks like rouge source highlighter support that, but styles needs to be included]
    I went over ascii-doctor github repo & all the examples are from before 2.0.0
    Ashok Koyi
    @thekalinga
    Is there a reason why we have separate asciidoctor & asciidoctorjclojures? and how do we know which one to use when?
    Ashok Koyi
    @thekalinga
    Given this the folder structure, what would be the values of baseDirFollowsSourceDir, baseDirIsProjectDir & baseDirIsRootProjectDir resolves to
    ├── build.gradle
    ├── gradle
    │   └── wrapper
    │       ├── gradle-wrapper.jar
    │       └── gradle-wrapper.properties
    ├── gradlew
    ├── gradlew.bat
    ├── settings.gradle
    └── src
        └── docs
            └── asciidoc
                ├── course
                │   ├── index.adoc
                │   └── snippets
                │       └── Test.java
                └── nested
                    └── course
                        ├── index.adoc
                        ├── sibling.adoc
                        └── snippets
                            └── Test.java